# Build from the repository root so the shared package is in context:
#   docker build -f services/controls/Dockerfile -t as0558844/controls .
FROM python:3.12-slim

WORKDIR /app

# shared first (the traceability spine), then the service itself
COPY shared /app/shared
RUN pip install --no-cache-dir /app/shared

COPY services/controls /app/services/controls
RUN pip install --no-cache-dir /app/services/controls

# the workbook's own reference values (the base extract the adjustment reads)
COPY seed /app/seed

ENV SERVICE_NAME=controls \
    SEED_DATA_DIR=/app/seed/data \
    PYTHONUNBUFFERED=1

EXPOSE 8004

CMD ["uvicorn", "controls.main:app", "--host", "0.0.0.0", "--port", "8004"]
