Skip to content

Instantly share code, notes, and snippets.

@hakaneroztekin
Created June 12, 2022 16:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hakaneroztekin/f0b016bf09282901213660e4fa4b4aff to your computer and use it in GitHub Desktop.
Save hakaneroztekin/f0b016bf09282901213660e4fa4b4aff to your computer and use it in GitHub Desktop.
spring-app [docker in a nutshell]
# 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