forked from buerokratt/Customer-service
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
27 lines (22 loc) · 771 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
ARG node_version=node:lts
ARG nginx_version=nginx:1.21.3-alpine
ARG sonarscanner_version=sonarsource/sonar-scanner-cli
FROM $node_version as image
WORKDIR /usr/customer-service
COPY ./package*.json ./
RUN npm config set registry https://nexus.riaint.ee/repository/npm-public/
FROM image AS build
ARG env=DEV
RUN npm ci
COPY . .
RUN npm run test:coverage
RUN npm run build
FROM $sonarscanner_version as sonar
ARG sonarscanner_params=-Dsonar.host.url=http://localhost:9000
COPY --from=build ./usr/customer-service .
RUN sonar-scanner $sonarscanner_params
FROM $nginx_version
COPY ./nginx/https-nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=build ./usr/customer-service/build /usr/share/nginx/html/customer-service
EXPOSE 443
CMD ["nginx", "-g", "daemon off;"]