-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (20 loc) · 835 Bytes
/
Dockerfile
File metadata and controls
32 lines (20 loc) · 835 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
### STAGE 1: Build ###
# We label our stage as ‘builder’
FROM node:10 as builder
COPY package.json yarn.lock ./
## Storing node modules on a separate layer will prevent unnecessary npm installs at each build
RUN npm i && mkdir /biergit-frontend && mv ./node_modules ./biergit-frontend
WORKDIR /biergit-frontend
COPY . .
## Build the angular app in production mode and store the artifacts in dist folder
RUN npm run-script build --prod
## Stage 2: Run
FROM nginx:alpine
## Copy our default nginx config
COPY config/nginx.conf /etc/nginx/conf.d/
## Remove default nginx website
RUN rm -rf /usr/share/nginx/html/*
## From ‘builder’ stage copy over the artifacts in dist folder to default nginx public folder
COPY --from=builder /biergit-frontend/build /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]