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

FROM node:22-slim AS builder
WORKDIR /app

COPY package.json package-lock.json* ./
RUN npm ci

COPY tsconfig.json ./
COPY src ./src
COPY scripts ./scripts
COPY mcp_store.db ./mcp_store.db

# mcp_store.db leaves the Rust generator with an empty semantic_endpoints
# table (vectors are computed here, in TypeScript, not by mcpify itself —
# see the plan's embeddings decision), so it must be populated before the
# image is usable.
RUN npm run populate-embeddings
RUN npm run build

FROM node:22-slim AS runtime
WORKDIR /app
ENV NODE_ENV=production

COPY package.json package-lock.json* ./
RUN npm ci --omit=dev

COPY --from=builder /app/dist ./dist
COPY --from=builder /app/mcp_store.db ./mcp_store.db

HEALTHCHECK --interval=30s --timeout=5s --retries=3 CMD node dist/healthcheck.js

ENTRYPOINT ["node", "dist/index.js"]
