-
Notifications
You must be signed in to change notification settings - Fork 0
/
ui.Dockerfile
46 lines (34 loc) · 835 Bytes
/
ui.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
39
40
41
42
43
44
45
46
#############
### build ###
#############
# base image
FROM node:16 as build
ARG configuration=production
# 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 ui/package.json .
COPY ui/yarn.lock .
RUN yarn install
# add app
COPY ui/ .
# run tests
# RUN ng test --watch=false
# RUN ng e2e --port 4202
# generate build
RUN ng build -c $configuration --base-href / --source-map=false
############
### prod ###
############
# base image
FROM nginx:1.17-alpine
# ENV BACKEND="/api"
# copy artifact build from the 'build environment'
COPY --from=build /app/dist/cardboard-box-anime /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf
# expose port 80
EXPOSE 80
# run nginx
CMD ["nginx", "-g", "daemon off;"]