# Generic kit image. Record the resolved base-image digest when qualifying a release.
FROM python:3.11-slim
ARG EXTRAS=""
ENV PYTHONDONTWRITEBYTECODE=1 \
    PYTHONUNBUFFERED=1 \
    HF_HUB_OFFLINE=1 \
    TRANSFORMERS_OFFLINE=1
WORKDIR /app
COPY pyproject.toml README.md ./
COPY src ./src
RUN if [ -n "$EXTRAS" ]; then python -m pip install --no-cache-dir ".[${EXTRAS}]"; \
    else python -m pip install --no-cache-dir .; fi \
    && useradd --uid 10001 --create-home recipe
COPY benchmarks ./benchmarks
COPY recipes ./recipes
COPY examples ./examples
RUN mkdir /results && chown recipe:recipe /results
USER recipe
ENTRYPOINT ["hessian-recipes"]
CMD ["demo", "--workspace", "/app", "--output", "/results/demo"]
