FROM zenika/alpine-chrome:with-playwright | |
WORKDIR /app | |
# Install Python and pip | |
RUN apk add --no-cache python3 py3-pip | |
# Copy requirements first for better caching | |
COPY requirements.txt . | |
RUN pip install --no-cache-dir -r requirements.txt | |
# Copy your code | |
COPY . . | |
# FastAPI and Uvicorn are already installed via requirements.txt | |
# Playwright browsers are already available in the base image | |
EXPOSE 7860 | |
# Run the FastAPI application | |
CMD ["python", "-m", "uvicorn", "scrape:app", "--host", "0.0.0.0", "--port", "7860"] | |