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