-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
33 lines (26 loc) · 949 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
FROM python:3.9-slim-bullseye
# Install Chrome and dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
wget \
gnupg2 \
xvfb \
&& wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list \
&& apt-get update && apt-get install -y --no-install-recommends \
google-chrome-stable \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean
# Set timezone
ENV TZ=America/Chicago
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# Set display port and Chrome options
ENV DISPLAY=:99
ENV CHROME_BIN=/usr/bin/google-chrome
WORKDIR /app
# Copy and install requirements
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy the script
COPY script.py .
# Command to run with xvfb
CMD ["python", "script.py"]