FROM python:3.12-slim

WORKDIR /app

COPY pyproject.toml README.md LICENSE ./
COPY src ./src
COPY examples/templates ./default-templates

RUN pip install --no-cache-dir ".[service]"

EXPOSE 8000

# Mount your own templates at /templates to override the bundled examples.
CMD ["sh", "-c", "exec marksense serve --host 0.0.0.0 --port 8000 --templates-dir $([ -d /templates ] && echo /templates || echo /app/default-templates)"]
