Spaces:
Building
Building
# Use Microsoft's Playwright-ready Docker image with Python | |
FROM mcr.microsoft.com/playwright:focal | |
# Set the working directory in the container to /app | |
WORKDIR /app | |
# Install python3 and pip3 | |
RUN apt-get update && apt-get install -y python3-pip | |
RUN python3 -m pip install --upgrade pip setuptools wheel | |
# Install Flask and Flask-RESTful | |
RUN pip3 install flask flask_restful | |
# Install playwright python package and the browsers | |
RUN pip3 install playwright | |
RUN playwright install | |
# Copy the Python scripts into the container at /app | |
COPY generator.py /app/ | |
COPY app.py /app/ | |
# Make port 8080 available to the world outside this container | |
EXPOSE 8080 | |
# Run generator.py and flask run when the container launches | |
CMD ["python3", "app.py"] |