Spaces:
Sleeping
Sleeping
File size: 983 Bytes
2c38cdf bf1885a 2c38cdf 6ab4554 bf1885a 6ab4554 2c38cdf bf1885a |
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 |
# Use an official Python runtime as a parent image
FROM mcr.microsoft.com/playwright/python:v1.40.0-jammy
# Set the working directory in the container
WORKDIR /app
# Copy the current directory contents into the container at /app
COPY . /app
# Install any needed packages specified in requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
# Download and install Chrome WebDriver
RUN apt-get update && \
apt-get install -y wget unzip && \
wget -q -O /tmp/chromedriver.zip https://chromedriver.storage.googleapis.com/94.0.4606.61/chromedriver_linux64.zip && \
unzip /tmp/chromedriver.zip chromedriver -d /usr/local/bin/ && \
rm /tmp/chromedriver.zip && \
apt-get remove -y wget unzip && \
rm -rf /var/lib/apt/lists/*
RUN playwright install chromium
# Make Chrome use the custom Chromium install
ENV CHROME_BIN=/usr/bin/chromium
ENV CHROME_PATH=/usr/lib/chromium/
EXPOSE 7860
# Run app.py when the container launches
CMD ["python","main.py"] |