# {{ display_name }} MCP server — generated by mcpify. Do not hand-edit.

FROM python:3.12-slim AS base
WORKDIR /app

RUN pip install --no-cache-dir uv

COPY pyproject.toml uv.lock* ./
COPY src ./src
COPY mcp_store.db ./mcp_store.db

# --frozen would fail the build if uv.lock is missing/stale; this is a
# freshly-generated project without a committed lockfile yet, so uv
# resolves and writes one on first sync instead.
RUN uv sync --no-dev

# mcp_store.db leaves the generator with an empty semantic_endpoints table
# (vectors are computed here, not by mcpify itself — see the plan's
# embeddings decision), so it must be populated before the image is usable.
RUN uv run python -m {{ module_name }}.services.populate_embeddings

HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
    CMD ["uv", "run", "{{ project_name }}", "test-connection"]

ENTRYPOINT ["uv", "run", "{{ project_name }}"]
