diff --git a/Dockerfile b/Dockerfile index 1bbf0f70b..792f60f94 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,18 @@ -# Use an official Maven runtime as a parent image -FROM maven:3.8.4-openjdk-17-slim AS build +# Use an official OpenJDK runtime as a parent image +FROM eclipse-temurin:17-jdk-jammy # Set the working directory in the container WORKDIR /app # Copy the compiled JAR file from the build stage -COPY target/*.jar /app/petclinic.jar +#COPY --from=build /home/azureuser/petclinic/target/*.jar /app/petclinic.jar +COPY .mvn/ .mvn/ +COPY mvnw pom.xml ./ +#Run the dependecies on the image +RUN ./mvnw dependency:resolve + +#COPY soruce code from local to the image +COPY src ./src # Specify the command to run on container start -CMD ["java", "-jar", "petclinic.jar"] \ No newline at end of file +CMD ["mvnw", "spring-boot:run"] \ No newline at end of file