Created
June 12, 2022 16:17
-
-
Save hakaneroztekin/f0b016bf09282901213660e4fa4b4aff to your computer and use it in GitHub Desktop.
spring-app [docker in a nutshell]
This file contains 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
# use openjdk 16 image | |
FROM openjdk:16 | |
# copy the jar from host to container | |
ADD target/spring-app.jar app/spring-app.jar | |
# make app default directory for the upcoming commands | |
WORKDIR /app | |
# expose port 8080 | |
EXPOSE 8080 | |
# when container starts execute: java -jar spring-app.jar | |
ENTRYPOINT ["java", "-jar", "spring-app.jar"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment