Fix: Run both sonar and clm scans in parallel
[ccsdk/cds.git] / cds-ui / application / Dockerfile
1 # Prepare stage for multistage image build
2 ## START OF stage0 ##
3 # Building client html and js files
4 FROM alpine:3.8 AS stage0
5 WORKDIR /opt/cds-ui/client/
6
7 RUN apk add --no-cache npm
8
9 COPY client/package.json /opt/cds-ui/client/
10 RUN npm install
11
12 COPY client /opt/cds-ui/client/
13 RUN npm run build
14
15 ## END OF STAGE0 ##
16
17 ##############################################
18
19 ## START OF stage1 ##
20 # Building and creating server
21 FROM alpine:3.8 AS stage1
22 WORKDIR /opt/cds-ui/
23
24 RUN apk add --no-cache npm
25
26 COPY server/package.json /opt/cds-ui/
27 RUN npm install
28
29 COPY server /opt/cds-ui/
30 RUN npm run build
31
32 ## END OF STAGE1 ##
33
34 ##############################################
35
36 ## This will create actual image
37
38 FROM alpine:3.8
39 WORKDIR /opt/cds-ui/
40
41 RUN apk add --no-cache npm
42
43 COPY --from=stage0 /opt/cds-ui /opt/cds-ui
44 COPY --from=stage1 /opt/cds-ui/server/public /opt/cds-ui/public
45
46 EXPOSE 3000
47 CMD [ "npm", "start" ]