-
-
Notifications
You must be signed in to change notification settings - Fork 933
/
Dockerfile
44 lines (29 loc) · 767 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
39
40
41
42
43
44
# builds the app and runs the webversion inside a docker container
### build ###
# base image
FROM node:20 as build
# add app
COPY . /app
# set working directory
WORKDIR /app
# add `/app/node_modules/.bin` to $PATH
ENV PATH /app/node_modules/.bin:$PATH
RUN npm i
RUN npm i -g @angular/cli
# run linter
RUN npm run lint
# generate build
RUN npm run buildFrontend:prodWeb
### serve ###
# base image
FROM nginx:1-alpine
# environmental variables
ENV PORT=80
# copy artifact build from the 'build environment'
COPY --from=build /app/dist/browser /usr/share/nginx/html
# copy nginx config
COPY ./nginx/default.conf.template /etc/nginx/templates/default.conf.template
# expose port: defaults to 80
EXPOSE $PORT
# run nginx
CMD ["nginx", "-g", "daemon off;"]