forked from aymanElakwah/kwikker-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
38 lines (29 loc) · 753 Bytes
/
Dockerfile
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
#########################
### build environment ###
#########################
# base image
FROM node as builder
WORKDIR /app
# install and cache app dependencies
# add `/app/node_modules/.bin` to $PATH
ENV PATH /app/node_modules/.bin:$PATH
COPY package.json .
RUN npm install
RUN npm install -g @angular/[email protected]
# add app
COPY . .
# generate build
RUN ng build --prod --named-chunks
##################
### production ###
##################
# base image
FROM nginx:alpine
# copy artifact build from the 'build environment'
COPY --from=builder /app/dist/kwikker/. /usr/share/nginx/html
# get configuration filees
COPY ./nginx/default.conf /etc/nginx/conf.d/default.conf
# expose port 80
EXPOSE 80
# run nginx
CMD ["nginx", "-g", "daemon off;"]