Created
July 25, 2020 06:22
-
-
Save dhilipsiva/d996ea7c84f5823751ed09748cae718a to your computer and use it in GitHub Desktop.
Multistage build dockerfile
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
# Stage 1: Build a React Docker Image | |
FROM node as build | |
WORKDIR /app | |
COPY package*.json /app/ | |
RUN npm install | |
COPY . /app | |
RUN npm run build | |
# Stage 2, use the compiled app, ready for production with Nginx | |
FROM nginx | |
COPY --from=build /app/dist/out/ /usr/share/nginx/html | |
COPY /nginx-custom.conf /etc/nginx/conf.d/default.conf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment