diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index a47cd458c..1ec7b1ad1 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -35,6 +35,9 @@ jobs: - name: Run tests run: mvn test + - name: Package the application with Maven + run: mvn package -DskipTests + - name: Build Docker image run: | docker build -t trialt0zppb.jfrog.io/onboarding-docker-local/spring-petclinic:latest . diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..e3c8936d9 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +# Use an official OpenJDK runtime as a parent image +FROM openjdk:17-jdk-slim + +# Set the working directory inside the container +WORKDIR /app + +# Copy the built JAR file from the target directory +COPY target/spring-petclinic-*.jar app.jar + +# Expose the application port +EXPOSE 8080 + +# Run the application +CMD ["java", "-jar", "app.jar"] +