# 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 backend imports this same package as a library; this image is the separate
# service form of it, so it can be scaled, restarted or pointed at a different model
# independently of the portal API.
#
# 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

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

# Installs the pinned dependencies from pyproject.toml along with the package. The
# copy at /srv/app stays on sys.path ahead of the installed one, so the dev overlay's
# source bind mount is what actually executes.
RUN pip install --no-cache-dir .

EXPOSE 8100

# No module-level `app` object exists on purpose (app/main.py), so the factory form
# is mandatory here.
CMD ["uvicorn", "app.main:create_app", "--factory", "--host", "0.0.0.0", "--port", "8100"]
