Skip to content

Instantly share code, notes, and snippets.

@changhuixu
Last active December 29, 2021 15:21
Show Gist options
  • Save changhuixu/bbd7c8ddfc6147302624efa3b48216e9 to your computer and use it in GitHub Desktop.
Save changhuixu/bbd7c8ddfc6147302624efa3b48216e9 to your computer and use it in GitHub Desktop.
# 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