Created
March 25, 2024 12:29
-
-
Save makomweb/1c72d442a8896249e0d425163380f9a9 to your computer and use it in GitHub Desktop.
Docker multi stage file for npm + webserver
This file contains 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
# 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