Skip to content

Instantly share code, notes, and snippets.

@alexei-led
Created March 17, 2017 11:33
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 alexei-led/4b90ca2dcb24c1f8dc19ccd1e72c6ad3 to your computer and use it in GitHub Desktop.
Save alexei-led/4b90ca2dcb24c1f8dc19ccd1e72c6ad3 to your computer and use it in GitHub Desktop.
Dockerize Java-Maven project
FROM maven:{{}}
# make source folder
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
# install maven packages
COPY pom.xml /usr/src/app
CMD ["mvn", "install"]
FROM openjdk:8-jre-alpine
COPY spring-boot-*.war /app.war
CMD ["/usr/bin/java", "-jar", "-Dspring.profiles.active=test", "/app.war"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment