forked from jhipster/jhipster-registry
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
30 lines (28 loc) · 923 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
27
28
29
30
FROM adoptopenjdk:11-jdk-hotspot as builder
ADD . /code/
RUN \
apt-get update && \
apt-get install build-essential -y && \
apt-get install dos2unix -y && \
cd /code/ && \
dos2unix mvnw && \
rm -Rf target node_modules && \
chmod +x /code/mvnw && \
sleep 1 && \
JHI_DISABLE_WEBPACK_LOGS=true ./mvnw package -ntp -Pprod -DskipTests && \
mv /code/target/*.jar /jhipster-registry.jar && \
apt-get clean && \
rm -Rf /code/ /root/.m2 /root/.cache /tmp/* /var/lib/apt/lists/* /var/tmp/*
FROM adoptopenjdk:11-jre-hotspot
ENV SPRING_OUTPUT_ANSI_ENABLED=ALWAYS \
JAVA_OPTS="" \
SPRING_PROFILES_ACTIVE=prod
EXPOSE 8761
RUN apt-get install -y curl && \
apt-get clean && \
mkdir /target && \
chmod g+rwx /target
CMD java \
${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom \
-jar /jhipster-registry.jar
COPY --from=builder /jhipster-registry.jar .