FROM python:3.9-slim # Set environment variables so Playwright works in a limited environment ENV PLAYWRIGHT_BROWSERS_PATH=/app/pw-browsers ENV HOME=/app WORKDIR /app RUN apt-get update && apt-get install -y wget gnupg && rm -rf /var/lib/apt/lists/* RUN pip install --no-cache-dir fastapi uvicorn playwright-stealth # Install browser in the local app folder RUN playwright install --with-deps chromium COPY . . # Give full permissions to the app folder RUN chmod -R 777 /app EXPOSE 7860 CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]