Create Dockerfile

This commit is contained in:
Mihai Georgescu 2023-11-27 13:07:43 +02:00 committed by GitHub
parent 923e2b7aa3
commit d9050dbff4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

18
Dockerfile Normal file
View file

@ -0,0 +1,18 @@
FROM openjdk:17.0.1-jdk-slim AS builder
WORKDIR /app
COPY src /app/src
COPY pom.xml .
COPY .mvn /app/.mvn
COPY mvnw .
RUN apt-get update && apt-get install -y dos2unix
RUN dos2unix mvnw && chmod +x mvnw
RUN ls -l
RUN ./mvnw package -DskipTests
FROM eclipse-temurin:17-jdk-jammy
COPY --from=builder /app/target/*.jar /app/spring-petclinic.jar
CMD [ "java", "-jar", "/app/spring-petclinic.jar" ]