precollege_scraper / Dockerfile
adityaiiitr's picture
Update Dockerfile
a27a468 verified
raw
history blame
1.41 kB
# Use an official Python runtime as a parent image
FROM python:3.9
# 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 install libnss3\
libnspr4\
libdbus-1-3\
libatk1.0-0\
libatk-bridge2.0-0\
libcups2\
libdrm2\
libxkbcommon0\
libatspi2.0-0\
libxcomposite1\
libxdamage1\
libxfixes3\
libxrandr2\
libgbm1\
libasound2
RUN playwright install chromium
# Make Chrome use the custom Chromium install
ENV CHROME_BIN=/usr/bin/chromium
ENV CHROME_PATH=/usr/lib/chromium/
# Expose the port the app runs on
EXPOSE 7860
# Run the command to start the FastAPI server
CMD ["python", "main.py"]