Created
October 7, 2017 14:28
-
-
Save dermatologist/22044bbe02fa71ca9726c473fc123176 to your computer and use it in GitHub Desktop.
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
FROM java:8 | |
# https://hub.docker.com/r/library/java/tags/ | |
# Install maven | |
RUN apt-get update | |
RUN apt-get install -y maven | |
WORKDIR /code | |
# Prepare by downloading dependencies | |
ADD pom.xml /code/pom.xml | |
RUN ["mvn", "dependency:resolve"] | |
RUN ["mvn", "verify"] | |
# Adding source, compile and package into a fat jar | |
ADD src /code/src | |
RUN ["mvn", "package"] | |
EXPOSE 4567 | |
CMD ["/usr/lib/jvm/java-8-openjdk-amd64/bin/java", "-jar", "target/jar-with-dependencies.jar"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment