forked from jhipster/jhipster-online
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
26 lines (25 loc) · 826 Bytes
/
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
FROM openjdk:8 as builder
ADD . /code/
RUN \
apt-get update && \
apt-get install build-essential -y && \
cd /code/ && \
rm -Rf target node_modules && \
chmod +x /code/mvnw && \
sleep 1 && \
./mvnw package -Pprod -DskipTests && \
mv /code/target/*.war / && \
apt-get clean && \
rm -Rf /code/ /root/.m2 /root/.cache /tmp/* /var/lib/apt/lists/* /var/tmp/*
FROM openjdk:8-jre-alpine
ENV SPRING_OUTPUT_ANSI_ENABLED=ALWAYS \
JHIPSTER_SLEEP=0 \
JAVA_OPTS=""
RUN apk update && \
apk add nodejs-current yarn && \
yarn global add [email protected]
CMD echo "The application will start in ${JHIPSTER_SLEEP}s..." && \
sleep ${JHIPSTER_SLEEP} && \
java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /jhonline*.war
EXPOSE 8080
COPY --from=builder /*.war .