Skip to content

Instantly share code, notes, and snippets.

@dlrandy
Forked from changhuixu/Dockerfile
Created June 10, 2020 15:18
Show Gist options
  • Save dlrandy/b3e3b8246f2337352f1f34b76e802e64 to your computer and use it in GitHub Desktop.
Save dlrandy/b3e3b8246f2337352f1f34b76e802e64 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