forked from Hazem-Ben-Khalfallah/scrum-poker-planning
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile-front
28 lines (21 loc) · 998 Bytes
/
Dockerfile-front
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
#Build stage 1
FROM maven:3.5.3-jdk-8 AS builder
MAINTAINER Hazem Ben Khalfallah <[email protected]>
RUN mkdir /app
ADD . /app/
WORKDIR /app
RUN mvn package -Dskip.unit.tests=true -Dskip.integration.tests=true
#Setup stage 2
FROM nginx:1.14.1-alpine
## Copy our default nginx config
COPY .nginx/default.conf /etc/nginx/conf.d/
## Remove default nginx website
RUN rm -rf /usr/share/nginx/html/*
## From ‘builder’ stage copy over the artifacts in dist folder to default nginx public folder
COPY --from=builder /app/src/main/webapp/index.html /usr/share/nginx/html
COPY --from=builder /app/src/main/webapp/dist/ /usr/share/nginx/html/dist/
COPY --from=builder /app/src/main/webapp/images/ /usr/share/nginx/html/images/
RUN echo "mainFileName=\"\$(ls /usr/share/nginx/html/dist/scrumPoker.js)\" && \
envsubst '\$API_URL \$API_PORT ' < \${mainFileName} > main.tmp && \
mv main.tmp \${mainFileName} && nginx -g 'daemon off;'" > run.sh
ENTRYPOINT ["sh", "run.sh"]