Skip to content

Instantly share code, notes, and snippets.

@philipz
Last active October 26, 2017 07:28
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 philipz/927e1fc1eac76261f65bc135b17665e7 to your computer and use it in GitHub Desktop.
Save philipz/927e1fc1eac76261f65bc135b17665e7 to your computer and use it in GitHub Desktop.
Multi-stage Dockerfile
FROM gradle:4.1-alpine as gradle
COPY source /home/gradle/
RUN gradle build

FROM openjdk:8-jdk-alpine
COPY --from=gradle /home/gradle/build/libs/gs-spring-boot-docker-0.1.0.jar /app.jar
ENV JAVA_OPTS=""
ENV PORT 5000
EXPOSE 5000
ENTRYPOINT [ "sh", "-c", "java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar /app.jar" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment