added dockerfile and updated ci pipeline

This commit is contained in:
Jesse Houldsworth 2025-03-13 13:20:51 -07:00
parent 577fda3708
commit 4f4a6a4d82
2 changed files with 18 additions and 0 deletions

View file

@ -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 .

15
Dockerfile Normal file
View file

@ -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"]