# Build from the repository root so the shared package is in context:
#   docker build -f services/audit/Dockerfile -t as0558844/audit .
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/audit /app/services/audit
RUN pip install --no-cache-dir /app/services/audit

# the workbook's own version history (LE005-LE009)
COPY seed /app/seed

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

EXPOSE 8006

CMD ["uvicorn", "audit.main:app", "--host", "0.0.0.0", "--port", "8006"]
