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

FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
WORKDIR /src

COPY {{ namespace }}.csproj ./
RUN dotnet restore

COPY . .
RUN dotnet publish {{ namespace }}.csproj -c Release -o /app/publish --no-restore

FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS final
WORKDIR /app
COPY --from=build /app/publish .
COPY mcp_store.db ./mcp_store.db

# 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 dotnet {{ namespace }}.dll populate-embeddings

HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
    CMD ["dotnet", "{{ namespace }}.dll", "test-connection"]

ENTRYPOINT ["dotnet", "{{ namespace }}.dll"]
