Skip to content

Instantly share code, notes, and snippets.

@ravshansbox
Created September 11, 2023 21:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ravshansbox/2c74a11b808ab12471c789336b181851 to your computer and use it in GitHub Desktop.
Save ravshansbox/2c74a11b808ab12471c789336b181851 to your computer and use it in GitHub Desktop.
FROM node:18-alpine AS base
WORKDIR /app
COPY package.json package-lock.json ./
FROM base AS dev
RUN npm ci
COPY . ./
RUN npm run build
FROM base AS prod
RUN npm ci --omit=dev
FROM base
COPY --from=prod /app/node_modules ./node_modules
COPY --from=dev /app/dist ./src
CMD npm run start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment