Last active
January 10, 2025 23:41
-
-
Save slimslenderslacks/d237b5ee5b64b16ffdd43e1e01e8d830 to your computer and use it in GitHub Desktop.
Dockerfile for a Typescript MCP Server using npm and an outDir named dist
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM node:22.12-alpine as builder | |
COPY . /app | |
WORKDIR /app | |
RUN --mount=type=cache,target=/root/.npm npm install | |
RUN --mount=type=cache,target=/root/.npm-production npm ci --ignore-scripts --omit-dev | |
FROM node:22-alpine AS release | |
COPY --from=builder /app/dist /app/dist | |
COPY --from=builder /app/package.json /app/package.json | |
COPY --from=builder /app/package-lock.json /app/package-lock.json | |
ENV NODE_ENV=production | |
WORKDIR /app | |
RUN npm ci --ignore-scripts --omit-dev | |
ENTRYPOINT ["node", "dist/index.js"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment