Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +28 -4
Dockerfile
CHANGED
@@ -1,20 +1,44 @@
|
|
1 |
-
FROM python:3.
|
|
|
|
|
2 |
|
3 |
RUN apt-get update && apt-get install -y
|
4 |
wget
|
5 |
curl
|
6 |
unzip
|
7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
&& rm -rf /var/lib/apt/lists/*
|
9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
RUN CHROME_DRIVER_VERSION=$(curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE)
|
11 |
-
&& wget -
|
12 |
&& unzip -o /tmp/chromedriver_linux64.zip -d /tmp/
|
13 |
&& chmod +x /tmp/chromedriver
|
14 |
-
&& mv /tmp/chromedriver /usr/local/bin/chromedriver
|
|
|
|
|
|
|
15 |
|
16 |
COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt
|
17 |
|
18 |
COPY app.py .
|
19 |
|
|
|
|
|
|
|
|
|
20 |
CMD ["python", "app.py"]
|
|
|
1 |
+
FROM python:3.10-slim
|
2 |
+
|
3 |
+
#Install system dependencies
|
4 |
|
5 |
RUN apt-get update && apt-get install -y
|
6 |
wget
|
7 |
curl
|
8 |
unzip
|
9 |
+
libglib2.0-0
|
10 |
+
libnss3
|
11 |
+
libgconf-2-4
|
12 |
+
libfontconfig1
|
13 |
+
libxrender1
|
14 |
+
libxtst6
|
15 |
+
libxi6
|
16 |
+
libgtk-3-0
|
17 |
&& rm -rf /var/lib/apt/lists/*
|
18 |
|
19 |
+
#Install Google Chrome
|
20 |
+
|
21 |
+
RUN wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
|
22 |
+
&& dpkg -i google-chrome-stable_current_amd64.deb; apt-get -fy install
|
23 |
+
&& rm google-chrome-stable_current_amd64.deb
|
24 |
+
|
25 |
+
#Install ChromeDriver
|
26 |
+
|
27 |
RUN CHROME_DRIVER_VERSION=$(curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE)
|
28 |
+
&& wget -q https://chromedriver.storage.googleapis.com/$CHROME_DRIVER_VERSION/chromedriver_linux64.zip -P /tmp/
|
29 |
&& unzip -o /tmp/chromedriver_linux64.zip -d /tmp/
|
30 |
&& chmod +x /tmp/chromedriver
|
31 |
+
&& mv /tmp/chromedriver /usr/local/bin/chromedriver
|
32 |
+
&& rm /tmp/chromedriver_linux64.zip
|
33 |
+
|
34 |
+
#Copy application files
|
35 |
|
36 |
COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt
|
37 |
|
38 |
COPY app.py .
|
39 |
|
40 |
+
#Set environment variable to avoid buffering issues
|
41 |
+
|
42 |
+
ENV PYTHONUNBUFFERED=1
|
43 |
+
|
44 |
CMD ["python", "app.py"]
|