Created
May 25, 2022 10:44
-
-
Save initcron/064d83c565e4ed7a2a9e9fdf3be3886a to your computer and use it in GitHub Desktop.
Multi Stage Dockerfile with entry point which adds 10s delay. This fixes the problem of application crashing due to database not being available when it is launched.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM schoolofdevops/maven:spring AS BUILD | |
WORKDIR /app | |
COPY . . | |
RUN mvn spring-javaformat:apply && \ | |
mvn package -DskipTests | |
FROM openjdk:8u201-jre-alpine AS RUN | |
EXPOSE 8080 | |
WORKDIR /run | |
COPY entrypoint.sh /usr/local/bin/ | |
COPY --from=BUILD /app/target/spring-petclinic-2.3.1.BUILD-SNAPSHOT.jar petclinic.jar | |
RUN ln -s usr/local/bin/docker-entrypoint.sh /entrypoint.sh | |
ENTRYPOINT ["entrypoint.sh"] | |
CMD java -jar petclinic.jar |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment