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

# the workbook's own reference values (permitted months, 147 schedule lines)
COPY seed /app/seed

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

EXPOSE 8001

CMD ["uvicorn", "workflow.main:app", "--host", "0.0.0.0", "--port", "8001"]
