Skip to content

Instantly share code, notes, and snippets.

@marweck
Last active October 16, 2018 22:24
Show Gist options
  • Save marweck/b0552812493af84b46f56b41ca5a4a16 to your computer and use it in GitHub Desktop.
Save marweck/b0552812493af84b46f56b41ca5a4a16 to your computer and use it in GitHub Desktop.
Java Dockerfile configuration for build and run
# --- 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