FROM python:3.13-slim # Prevent Python from writing .pyc files and enable unbuffered stdout/stderr ENV PYTHONDONTWRITEBYTECODE=1 \ PYTHONUNBUFFERED=1 \ PIP_DISABLE_PIP_VERSION_CHECK=1 \ # Playwright won't be installed for actual browser automation PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 WORKDIR /app # Install build deps (some packages may need them to compile wheels) RUN apt-get update \ && apt-get install -y --no-install-recommends build-essential gcc \ && rm -rf /var/lib/apt/lists/* # Upgrade packaging tools COPY requirements.txt ./ RUN pip install --no-cache-dir \ --extra-index-url https://git.theprivateserver.de/api/packages/PHB/pypi/simple/ \ -r requirements.txt && \ # Clean up pip cache rm -rf /root/.cache/pip # Copy application source COPY . /app EXPOSE 8001 # Run using uvicorn; the app is defined in `api_service.py` as `app` CMD ["uvicorn", "api_service:app", "--host", "0.0.0.0", "--port", "8001"]