Skip to content

Instantly share code, notes, and snippets.

@makomweb
Created March 25, 2024 12:29
Show Gist options
  • Save makomweb/1c72d442a8896249e0d425163380f9a9 to your computer and use it in GitHub Desktop.
Save makomweb/1c72d442a8896249e0d425163380f9a9 to your computer and use it in GitHub Desktop.
Docker multi stage file for npm + webserver
# Docker multistage
# 1. stage to run npm install
# 2. stage to create a webserver image with the build artifact from stage 1
FROM node:latest as build-stage
WORKDIR /app
COPY ./ /app/
RUN npm install
FROM nginx:alpine
COPY --from=build-stage /app/ /usr/share/nginx/html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment