Sylvain Desbureaux | ae7b27a | 2019-02-14 13:45:22 +0100 | [diff] [blame] | 1 | # Building client html and js files |
| 2 | FROM alpine:3.8 as builder |
| 3 | |
| 4 | RUN apk add --no-cache npm |
| 5 | |
| 6 | WORKDIR /opt/cds-ui/client/ |
| 7 | |
| 8 | COPY client/package.json /opt/cds-ui/client/ |
| 9 | |
| 10 | RUN npm install |
| 11 | |
| 12 | COPY client /opt/cds-ui/client/ |
| 13 | |
| 14 | RUN npm run build |
| 15 | |
| 16 | |
| 17 | # Building and creating server |
| 18 | FROM alpine:3.8 |
| 19 | |
| 20 | WORKDIR /opt/cds-ui/ |
| 21 | |
| 22 | RUN apk add --no-cache npm |
| 23 | |
| 24 | COPY server/package.json /opt/cds-ui/ |
| 25 | |
| 26 | RUN npm install |
| 27 | |
| 28 | COPY server /opt/cds-ui/ |
| 29 | COPY --from=builder /opt/cds-ui/server/public /opt/cds-ui/public |
| 30 | |
| 31 | RUN npm run build |
| 32 | |
| 33 | EXPOSE 3000 |
| 34 | |
| 35 | CMD [ "npm", "start" ] |