forked from jhipster/jhipster-lite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
18 lines (17 loc) · 663 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
FROM openjdk:21-slim AS build
COPY . /code/jhipster-app/
WORKDIR /code/jhipster-app/
RUN chmod +x mvnw && ./mvnw package -B -DskipTests -Dmaven.javadoc.skip=true -Dmaven.source.skip -Ddevelocity.cache.remote.enabled=false
RUN mv /code/jhipster-app/target/*-exec.jar /code/
FROM openjdk:21-slim
COPY --from=build /code/*.jar /code/
RUN \
# configure the "jhipster" user
groupadd jhipster && \
useradd jhipster -s /bin/bash -m -g jhipster -G sudo && \
echo 'jhipster:jhipster'|chpasswd
ENV SPRING_OUTPUT_ANSI_ENABLED=ALWAYS \
JAVA_OPTS=""
USER jhipster
CMD java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /code/*.jar
EXPOSE 7471