forked from jhipster/jhipster-online
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
30 lines (29 loc) · 1.15 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
FROM adoptopenjdk:11-jdk-hotspot-bionic 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 -Pgcp -DskipTests && \
mv /code/target/*.war / && \
apt-get clean && \
rm -Rf /code/ /root/.m2 /root/.cache /tmp/* /var/lib/apt/lists/* /var/tmp/* && \
mkdir /tmp/jhispter && mkdir /tmp/jhispter/applications
FROM adoptopenjdk:11-jre-hotspot
ENV SPRING_OUTPUT_ANSI_ENABLED=ALWAYS \
JHIPSTER_SLEEP=0 \
JAVA_OPTS=""
RUN curl -sL https://deb.nodesource.com/setup_lts.x | bash - && \
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \
apt-get update && \
apt-get install -y nodejs 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 .