-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.server-prod
46 lines (31 loc) · 1.21 KB
/
Dockerfile.server-prod
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
FROM tjokvol/montepoeli-base-node-modules:latest as builder
# bcrypt dependencies
RUN apt-get update && apt-get -y upgrade && apt-get -y install python3 make g++
COPY package.json package.json
COPY package-lock.json package-lock.json
COPY apps/api/tsconfig.json apps/api/tsconfig.json
COPY apps/api/tsconfig.app.json apps/api/tsconfig.app.json
COPY apps/api/.eslintrc.json apps/api/.eslintrc.json
COPY apps/api/tsconfig.build.json apps/api/tsconfig.build.json
COPY apps/api/tsconfig.spec.json apps/api/tsconfig.spec.json
COPY apps/api/jest.config.js apps/api/jest.config.js
COPY tsconfig.json tsconfig.json
COPY jest.config.js jest.config.js
COPY .eslintrc.json .eslintrc.json
COPY nx.json nx.json
COPY angular.json angular.json
COPY apps/api/src apps/api/src
RUN npm install
RUN npm run api:lint
RUN npm run api:test:cov
RUN npm run api:build
RUN npm install -g depcheck
COPY remove-unused-deps.sh remove-unused-deps.sh
COPY .depcheckrc .depcheckrc
RUN ./remove-unused-deps.sh
RUN npm prune --production
FROM node:12-slim
COPY --from=builder /usr/src/app/node_modules /node_modules
COPY --from=builder /usr/src/app/dist/apps/api/* /dist/
COPY --from=builder /usr/src/app/coverage/apps/api/* /usr/coverage/
EXPOSE 3000