Skip to content

Instantly share code, notes, and snippets.

@jgcmarins
Created June 30, 2025 14:32
Show Gist options
  • Select an option

  • Save jgcmarins/e6909359b84b2623ba7893e9c54dce0c to your computer and use it in GitHub Desktop.

Select an option

Save jgcmarins/e6909359b84b2623ba7893e9c54dce0c to your computer and use it in GitHub Desktop.

Revisions

  1. jgcmarins created this gist Jun 30, 2025.
    16 changes: 16 additions & 0 deletions Dockerfile
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    FROM node:22.16-alpine AS builder
    WORKDIR /app
    COPY package.json yarn.lock ./
    RUN yarn install --frozen-lockfile
    COPY . .
    RUN yarn build
    RUN rm -rf node_modules && yarn install --production --frozen-lockfile

    FROM alpine AS runtime
    WORKDIR /app
    RUN apk add --no-cache nodejs-lts
    COPY --from-builder /app/package.json ./
    COPY --from-builder /app/node_modules ./node_ modules
    COPY --from-builder /app/dist ./dist
    EXPOSE 3000
    CMD ["node", "dist/main"]