Last active
October 16, 2018 22:24
-
-
Save marweck/b0552812493af84b46f56b41ca5a4a16 to your computer and use it in GitHub Desktop.
Java Dockerfile configuration for build and run
This file contains hidden or 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
| # --- builder --- | |
| FROM openjdk:8-jdk-alpine AS builder | |
| COPY . /usr/src/app/ | |
| WORKDIR /usr/src/app/ | |
| RUN apk --no-cache add maven && mvn package -Dmaven.test.skip=true | |
| # --- release --- | |
| FROM openjdk:8-jre-alpine AS release | |
| COPY --from=builder /usr/src/app/target/app-final-name.jar . | |
| VOLUME /var/log/app | |
| EXPOSE 8080 | |
| ENTRYPOINT ["./app-final-name.jar"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment