generator.server.springboot.docker.Dockerfile-maven.mustache Maven / Gradle / Ivy
FROM openjdk:21-slim
COPY . /code/jhipster-app/
RUN \
cd /code/jhipster-app/ && \
rm -Rf {{projectBuildDirectory}} node_modules && \
chmod +x mvnw && \
sleep 1 && \
./mvnw package -DskipTests && \
mv /code/jhipster-app/{{projectBuildDirectory}}/*.jar /code/ && \
rm -Rf /code/jhipster-app/ /root/.m2 /root/.cache /tmp/* /var/tmp/*
ENV SPRING_OUTPUT_ANSI_ENABLED=ALWAYS \
JHIPSTER_SLEEP=0 \
JAVA_OPTS=""
CMD echo "The application will start in ${JHIPSTER_SLEEP}s..." && \
sleep ${JHIPSTER_SLEEP} && \
java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /code/*.jar
EXPOSE {{serverPort}}