# syntax=docker/dockerfile:1
#
# Bulk ATS scoring engine — the standalone FastAPI service (CLAUDE.md is its spec).
# Serves POST /api/v1/score, GET /api/v1/health and the card-grid test UI at /.
#
# THE BUILD CONTEXT IS THE REPO ROOT (pyproject.toml lives there):
#
#     docker build -f app/Dockerfile -t hrms-ats-engine:local .

FROM python:3.12-slim

ENV PYTHONUNBUFFERED=1 \
    PYTHONDONTWRITEBYTECODE=1 \
    PIP_NO_CACHE_DIR=1 \
    PYTHONPATH=/srv

WORKDIR /srv

RUN groupadd --system app && useradd --system --gid app --home-dir /srv --shell /usr/sbin/nologin app

COPY pyproject.toml ./
COPY app/ ./app/

# Installs the pinned dependencies from pyproject.toml along with the package.
RUN pip install --no-cache-dir . \
    && chown -R app:app /srv

USER app

EXPOSE 8100

CMD ["uvicorn", "app.main:create_app", "--factory", "--host", "0.0.0.0", "--port", "8100"]
