gitza-mcp/Dockerfile

24 lines
916 B
Docker

FROM node:24.15.0-alpine AS builder
WORKDIR /build
RUN corepack enable
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile --ignore-scripts
COPY tsconfig.json tsconfig.build.json ./
COPY src ./src
COPY migrations ./migrations
RUN pnpm build
RUN rm -rf node_modules && pnpm install --prod --frozen-lockfile --ignore-scripts
FROM node:24.15.0-alpine AS runner
WORKDIR /app
ENV NODE_ENV=production HOST=0.0.0.0 PORT=3400
COPY --from=builder --chown=node:node /build/node_modules ./node_modules
COPY --from=builder --chown=node:node /build/dist ./dist
COPY --from=builder --chown=node:node /build/migrations ./migrations
COPY --chown=node:node package.json README.md OPERATIONS.md RELEASE.md LICENSE THIRD-PARTY-NOTICES.md ./
USER node
EXPOSE 3400
HEALTHCHECK --interval=30s --timeout=5s --start-period=15s --retries=3 \
CMD node dist/healthcheck.js
ENTRYPOINT ["node", "dist/cli.js"]
CMD ["http"]