FROM python:3.10-slim # Install basic build tools and curl RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential \ curl \ && rm -rf /var/lib/apt/lists/* # Set up a new user named "user" with UID 1000 RUN useradd -m -u 1000 user WORKDIR /code # Copy requirements and install COPY requirements.txt /code/requirements.txt RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt # Install Playwright browsers and their system dependencies automatically RUN playwright install --with-deps chromium # Set permissions for the user RUN chown -R user:user /code USER user # Copy application files COPY --chown=user:user . /code # Expose Hugging Face standard port EXPOSE 7860 # Run FastAPI app on port 7860 CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]