-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
41 lines (31 loc) · 940 Bytes
/
Dockerfile
File metadata and controls
41 lines (31 loc) · 940 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
#########################
### build environment ###
### Ref: https://github.com/avatsaev/angular4-docker-example
### http://mherman.org/blog/2018/02/26/dockerizing-an-angular-app/#.WuLSdNNuaL4
#########################
# base image
FROM node:18.3.0 as builder
# set working directory
RUN mkdir /app
WORKDIR /app
# install and cache app dependencies
COPY package.json /app/package.json
COPY package-lock.json /app/package-lock.json
RUN npm install -g npm@latest
RUN npm install --force
RUN npm install -g @angular/cli@14.0.1
# add app
COPY . /app
# Build the angular app in production mode and store the artifacts in dist folder
RUN npm run build
##################
### production ###
##################
# base image
FROM nginx:1.21.6-alpine
# copy artifact build from the 'build environment'
COPY --from=builder /app/dist/cloudman-ui /usr/share/nginx/html
# expose port 80
EXPOSE 80
# run nginx
CMD ["nginx", "-g", "daemon off;"]