forked from deso-protocol/identity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
43 lines (30 loc) · 970 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
FROM node:14.15.5-alpine3.13 AS identity
WORKDIR /identity
RUN apk add git
COPY ./package.json .
COPY ./package-lock.json .
COPY ./.npmrc .
# use yarn to upgrade npm
RUN yarn global add npm@7
# install frontend dependencies before copying the frontend code
# into the container so we get docker cache benefits
RUN npm install
# don't allow any dependencies with vulnerabilities
RUN npx audit-ci --low
# running ngcc before build_prod lets us utilize the docker
# cache and significantly speeds up builds without requiring us
# to import/export the node_modules folder from the container
RUN npm run ngcc
COPY ./angular.json .
COPY ./tsconfig.json .
COPY ./tsconfig.app.json .
COPY ./webpack.config.js .
COPY ./tslint.json .
COPY ./src ./src
RUN npm run build_prod
# build minified version of frontend, served using caddy
FROM caddy:2.3.0-alpine
WORKDIR /identity
COPY ./Caddyfile .
COPY --from=identity /identity/dist/identity .
ENTRYPOINT ["caddy", "run"]