Skip to content

Instantly share code, notes, and snippets.

@urbontaitis
Last active July 22, 2020 12:18
Show Gist options
  • Save urbontaitis/63f286cc3e21624be64188f983561f9a to your computer and use it in GitHub Desktop.
Save urbontaitis/63f286cc3e21624be64188f983561f9a to your computer and use it in GitHub Desktop.
adoptopenjdk docker file: build + run
FROM maven:3.6.3-adoptopenjdk-14 as build
WORKDIR /app
COPY pom.xml /app
COPY src /app/src
RUN mvn install
FROM openjdk:14-alpine
WORKDIR /app
COPY --from=build /app/target/app.jar /app
EXPOSE 8080
CMD ["java", "-Dspring.profiles.active=${ENVIRONMENT}", "-Xmx128m", "-jar", "app.jar"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment