forked from dessalines/simple-vote
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
executable file
·32 lines (23 loc) · 1.01 KB
/
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
28
29
30
31
32
FROM node:8.12.0 as node-builder
# Hacky workaround for installing @angular/cli
# RUN chmod a+w /usr/local/lib/node_modules && chmod a+w /usr/local/bin
# USER node
# RUN npm i -g @angular/cli@latest
# Build front end resources
USER root
ARG UI_PATH=/opt/simple-vote/ui
COPY ui ${UI_PATH}
WORKDIR ${UI_PATH}
ARG ENDPOINT_NAME=http://localhost:4567
RUN echo "ENDPOINT_NAME is ${ENDPOINT_NAME}"
RUN echo "export const environment = {production: true,endpoint: '${ENDPOINT_NAME}/',websocket: 'ws`echo ${ENDPOINT_NAME}|cut -b 5-999`/poll'};" > src/environments/environment.prod.ts
RUN cat src/environments/environment.prod.ts
RUN yarn
RUN yarn build
FROM maven:3.5.4-jdk-11-slim as java-builder
COPY service /opt/simple-vote/service
COPY --from=node-builder /opt/simple-vote/ui/dist/ /opt/simple-vote/service/src/main/resources/dist/
WORKDIR /opt/simple-vote/service
RUN mvn clean install -DskipTests -Dliquibase.skip
FROM openjdk:11-slim
COPY --from=java-builder /opt/simple-vote/service/target/simplevote.jar /opt/simplevote.jar