Last active
December 29, 2021 15:21
-
-
Save changhuixu/bbd7c8ddfc6147302624efa3b48216e9 to your computer and use it in GitHub Desktop.
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
# 1. Build our Angular app | |
FROM node:alpine as builder | |
WORKDIR /app | |
COPY package.json package-lock.json ./ | |
ENV CI=1 | |
RUN npm ci | |
COPY . . | |
RUN npm run build -- --prod --output-path=/dist | |
# 2. Deploy our Angular app to NGINX | |
FROM nginx:alpine | |
## Replace the default nginx index page with our Angular app | |
RUN rm -rf /usr/share/nginx/html/* | |
COPY --from=builder /dist /usr/share/nginx/html | |
COPY ./.nginx/nginx.conf /etc/nginx/nginx.conf | |
ENTRYPOINT ["nginx", "-g", "daemon off;"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment