Skip to content

Instantly share code, notes, and snippets.

@inyee786
Last active April 2, 2019 18:03
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 inyee786/24bdd306bbc65dfd9b414100f1d93428 to your computer and use it in GitHub Desktop.
Save inyee786/24bdd306bbc65dfd9b414100f1d93428 to your computer and use it in GitHub Desktop.
# Stage 0, "build-stage", based on Node.js, to build and compile the frontend
FROM node:10.8.0 as build-stage
WORKDIR /app
COPY package*.json /app/
RUN npm install
COPY ./ /app/
ARG configuration=production
RUN npm run build -- --output-path=./dist/out --configuration $configuration
# Stage 1, based on Nginx, to have only the compiled app
FROM nginx:1.15
#Copy dist folder to ngnix
COPY --from=build-stage /app/dist/out/ /usr/share/nginx/html
#Copy default nginx configuration
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