1 # Prepare stage for multistage image build
3 # Building client html and js files
4 FROM alpine:3.8 AS stage0
5 WORKDIR /opt/cds-ui/client/
7 RUN apk add --no-cache npm
9 COPY client/package.json /opt/cds-ui/client/
12 COPY client /opt/cds-ui/client/
17 ##############################################
20 # Building and creating server
21 FROM alpine:3.8 AS stage1
24 RUN apk add --no-cache npm
26 COPY server/package.json /opt/cds-ui/
29 COPY server /opt/cds-ui/
34 ##############################################
36 ## This will create actual image
41 RUN apk add --no-cache npm
43 COPY --from=stage0 /opt/cds-ui /opt/cds-ui
44 COPY --from=stage1 /opt/cds-ui/server/public /opt/cds-ui/public
47 CMD [ "npm", "start" ]