Created
January 21, 2023 07:34
-
-
Save sheikhoo/e09976a4507aa3eb5aa646d6f5454682 to your computer and use it in GitHub Desktop.
Dockerfile example Spring Boot 3 & JDK 17
This file contains 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
FROM maven:3.8.3-openjdk-17 AS builder | |
ADD . /app | |
WORKDIR /app | |
RUN mvn -f /app/pom.xml clean package | |
FROM openjdk:17.0.1-jdk-slim | |
COPY --from=builder /app/target/<TARGET-JAR-FILE-NAME>.jar app.jar | |
EXPOSE 8080 | |
ENTRYPOINT ["java","-jar","app.jar"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment