Created
June 23, 2021 02:49
-
-
Save pablohdzvizcarra/ebaa74b9b965ab5c4e92b880578e692a to your computer and use it in GitHub Desktop.
dockerfile to app java with compile 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
# Build Stage | |
FROM maven:3.8.1-openjdk-11-slim AS build | |
COPY src /home/app/src | |
COPY pom.xml /home/app | |
RUN mvn -f /home/app/pom.xml clean package | |
# Package stage | |
FROM openjdk:11-jre-slim | |
COPY --from=build /home/app/target/name-file-1.0-SNAPSHOT.jar /usr/local/lib/demo.jar | |
ENV PORT=8080 | |
EXPOSE 8080 | |
ENTRYPOINT ["java", "-jar", "/usr/local/lib/demo.jar"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment