-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
48 lines (36 loc) · 1.07 KB
/
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
47
48
#############
### build ###
#############
# base image
FROM groupclaes/angular-cli:18 AS build
# set working directory
WORKDIR /app
# install and cache app dependencies
COPY package.json /app/package.json
COPY .npmrc /app/.npmrc
ENV NODE_ENV=test
RUN npm install --ignore-scripts --legacy-peer-deps
# copy required files for build
COPY ./src /app/src
# COPY server.ts /app/server.ts
COPY angular.json /app/angular.json
COPY tsconfig.json /app/tsconfig.json
COPY tsconfig.app.json /app/tsconfig.app.json
COPY tailwind.config.js /app/tailwind.config.js
COPY ngsw-config.json /app/ngsw-config.json
COPY capitalize.d.ts /app/capitalize.d.ts
RUN ng build --configuration production --output-path=dist
COPY nginx.conf /app/nginx.conf
############
### prod ###
############
# base image
FROM groupclaes/nginx:latest
#remove all content form html
RUN rm -rf /usr/share/nginx/html/*
# USER nginx
# copy artifact build from the 'build environment'
COPY --from=build /app/dist /usr/share/nginx/html
COPY --from=build /app/nginx.conf /etc/nginx/conf.d/default.conf
# expose port 80
EXPOSE 80