Created
June 20, 2020 17:27
-
-
Save stephendarling/633dc750f1347b9fd5a5dc9a188b96d2 to your computer and use it in GitHub Desktop.
Use multiple images in Dockerfile
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
| # Create first image as Builder | |
| FROM node:12.16.1-alpine As builder | |
| WORKDIR /usr/src/app | |
| COPY package.json package-lock.json ./ | |
| RUN npm install | |
| COPY . . | |
| RUN npm run build --prod | |
| FROM nginx:1.15.8-alpine | |
| # Copy files from the first image using the builder reference | |
| COPY --from=builder /usr/src/app/dist/app-test/ /usr/share/nginx/html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment