Skip to content

Instantly share code, notes, and snippets.

@bayzi
Created September 27, 2019 14:11
Show Gist options
  • Save bayzi/703ba4d517112298687b332499dc2ee8 to your computer and use it in GitHub Desktop.
Save bayzi/703ba4d517112298687b332499dc2ee8 to your computer and use it in GitHub Desktop.
FROM maven:3.5.4-jdk-8-alpine as builder
WORKDIR /app
COPY pom.xml ./
RUN mvn dependency:go-offline
COPY src src
RUN mvn package
FROM openjdk:8-jre-alpine
RUN addgroup app && adduser app -D -G app
USER app
COPY --from=builder /app/target/*.jar app.jar
EXPOSE 8080
ENTRYPOINT ["java","-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