Spaces:
Sleeping
Sleeping
# Use the official Python runtime as a base image | |
FROM python:3.10-slim | |
# Set working directory | |
WORKDIR /app | |
# Install system dependencies: Chrome and ChromeDriver | |
RUN apt-get update && apt-get install -y \ | |
wget \ | |
unzip \ | |
libglib2.0-0 \ | |
libnss3 \ | |
libgconf-2-4 \ | |
libfontconfig1 \ | |
&& 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-chrome.list \ | |
&& apt-get update && apt-get install -y google-chrome-stable \ | |
&& wget https://chromedriver.storage.googleapis.com/114.0.5735.90/chromedriver_linux64.zip \ | |
&& unzip chromedriver_linux64.zip -d /usr/local/bin/ \ | |
&& rm chromedriver_linux64.zip \ | |
&& apt-get clean \ | |
&& rm -rf /var/lib/apt/lists/* | |
# Copy requirements file and install Python dependencies | |
COPY requirements.txt . | |
RUN pip install --no-cache-dir -r requirements.txt | |
# Copy your application code | |
COPY . . | |
# Run the app | |
CMD ["python", "app.py"] |