Spaces:
Build error
Build error
Update dockerfile
Browse files- dockerfile +2 -7
dockerfile
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
# Use Python 3.9 slim
|
| 2 |
FROM python:3.9-slim
|
| 3 |
|
| 4 |
-
# Install system dependencies
|
| 5 |
RUN apt-get update && apt-get install -y \
|
| 6 |
wget \
|
| 7 |
gnupg \
|
|
@@ -29,7 +29,7 @@ RUN apt-get update && apt-get install -y \
|
|
| 29 |
&& apt-get install -y google-chrome-stable \
|
| 30 |
&& rm -rf /var/lib/apt/lists/*
|
| 31 |
|
| 32 |
-
# Install matching
|
| 33 |
RUN CHROME_MAJOR_VERSION=$(google-chrome-stable --version | awk '{print $3}' | cut -d'.' -f1) \
|
| 34 |
&& CHROMEDRIVER_VERSION=$(wget -qO- https://chromedriver.storage.googleapis.com/LATEST_RELEASE_$CHROME_MAJOR_VERSION) \
|
| 35 |
&& wget -O /tmp/chromedriver.zip https://chromedriver.storage.googleapis.com/$CHROMEDRIVER_VERSION/chromedriver_linux64.zip \
|
|
@@ -37,18 +37,13 @@ RUN CHROME_MAJOR_VERSION=$(google-chrome-stable --version | awk '{print $3}' | c
|
|
| 37 |
&& chmod +x /usr/bin/chromedriver \
|
| 38 |
&& rm /tmp/chromedriver.zip
|
| 39 |
|
| 40 |
-
# Set up app directory
|
| 41 |
WORKDIR /app
|
| 42 |
|
| 43 |
-
# Copy requirements and install
|
| 44 |
COPY requirements.txt .
|
| 45 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 46 |
|
| 47 |
-
# Copy app
|
| 48 |
COPY app.py .
|
| 49 |
|
| 50 |
-
# Set environment variable for port
|
| 51 |
ENV PORT=7860
|
| 52 |
|
| 53 |
-
# Run the app
|
| 54 |
CMD ["python", "app.py"]
|
|
|
|
| 1 |
# Use Python 3.9 slim
|
| 2 |
FROM python:3.9-slim
|
| 3 |
|
| 4 |
+
# Install system dependencies
|
| 5 |
RUN apt-get update && apt-get install -y \
|
| 6 |
wget \
|
| 7 |
gnupg \
|
|
|
|
| 29 |
&& apt-get install -y google-chrome-stable \
|
| 30 |
&& rm -rf /var/lib/apt/lists/*
|
| 31 |
|
| 32 |
+
# Install ChromeDriver (specific matching version)
|
| 33 |
RUN CHROME_MAJOR_VERSION=$(google-chrome-stable --version | awk '{print $3}' | cut -d'.' -f1) \
|
| 34 |
&& CHROMEDRIVER_VERSION=$(wget -qO- https://chromedriver.storage.googleapis.com/LATEST_RELEASE_$CHROME_MAJOR_VERSION) \
|
| 35 |
&& wget -O /tmp/chromedriver.zip https://chromedriver.storage.googleapis.com/$CHROMEDRIVER_VERSION/chromedriver_linux64.zip \
|
|
|
|
| 37 |
&& chmod +x /usr/bin/chromedriver \
|
| 38 |
&& rm /tmp/chromedriver.zip
|
| 39 |
|
|
|
|
| 40 |
WORKDIR /app
|
| 41 |
|
|
|
|
| 42 |
COPY requirements.txt .
|
| 43 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 44 |
|
|
|
|
| 45 |
COPY app.py .
|
| 46 |
|
|
|
|
| 47 |
ENV PORT=7860
|
| 48 |
|
|
|
|
| 49 |
CMD ["python", "app.py"]
|