-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
45 lines (33 loc) · 822 Bytes
/
Dockerfile
File metadata and controls
45 lines (33 loc) · 822 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
33
34
35
36
37
38
39
40
41
42
43
44
45
#############
### build ###
#############
# base image
FROM node:12.18.2 as build
# set working directory
WORKDIR /app
# add `/app/node_modules/.bin` to $PATH
ENV PATH /app/node_modules/.bin:$PATH
# install and cache app dependencies
COPY package.json /app/package.json
COPY src/favicon.ico /app/src/favicon.ico
COPY src/assets /app/src/assets
COPY src/assets/font /app/src/assets/font
RUN npm install
RUN npm install -g @angular/cli@9.1.10
# add app
COPY . /app
# generate build
RUN ng build --prod --output-path=dist
############
### prod ###
############
# base image
FROM nginx
# copy artifact build from the 'build environment'
COPY --from=build /app/dist /usr/share/nginx/html
RUN chmod 644 /usr/share/nginx/html/*
# expose port 80
EXPOSE 8443
EXPOSE 8080
# run nginx
CMD ["nginx", "-g", "daemon off;"]