FROM python:3.12.8-slim-bookworm WORKDIR /app COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt && useradd --uid 10001 --create-home app COPY src/ src/ COPY migrations/ migrations/ COPY scripts/ scripts/ COPY tests/ tests/ COPY contracts/ contracts/ COPY lab.json . ENV PYTHONUNBUFFERED=1 PYTHONDONTWRITEBYTECODE=1 USER app EXPOSE 8080 CMD ["gunicorn", "--bind", "0.0.0.0:8080", "--workers", "1", "--threads", "4", "--timeout", "30", "--graceful-timeout", "5", "src.app:app"]