FROM python:3.12-slim WORKDIR /srv COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt COPY app/ ./app/ ARG APP_VERSION=dev ENV APP_VERSION=${APP_VERSION} RUN useradd -r -u 1001 appuser USER appuser EXPOSE 8000 HEALTHCHECK --interval=30s --timeout=3s CMD python -c "import urllib.request;urllib.request.urlopen('http://127.0.0.1:8000/health')" CMD ["gunicorn", "--bind", "0.0.0.0:8000", "--workers", "2", "app.main:app"]