hatchling validates readme field during wheel build — the file must be present in the Docker build context.
28 lines
659 B
Docker
28 lines
659 B
Docker
# --- Dependencies ---
|
|
FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim AS deps
|
|
WORKDIR /app
|
|
|
|
COPY pyproject.toml uv.lock README.md ./
|
|
COPY src/ src/
|
|
|
|
RUN --mount=type=cache,target=/root/.cache/uv \
|
|
uv sync --frozen --no-dev --no-editable
|
|
|
|
# --- Runtime ---
|
|
FROM python:3.12-slim-bookworm AS runtime
|
|
WORKDIR /app
|
|
|
|
ENV UV_COMPILE_BYTECODE=1
|
|
ENV PATH="/app/.venv/bin:$PATH"
|
|
|
|
COPY --from=deps /app/.venv /app/.venv
|
|
COPY src/ src/
|
|
|
|
EXPOSE 8000
|
|
|
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
|
|
CMD python -c "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/mcp')" || exit 1
|
|
|
|
USER nobody
|
|
CMD ["mcnoaa-tides"]
|