mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-15 20:25:50 +00:00
added dockerfile and updated ci pipeline
This commit is contained in:
parent
577fda3708
commit
4f4a6a4d82
2 changed files with 18 additions and 0 deletions
3
.github/workflows/ci-pipeline.yml
vendored
3
.github/workflows/ci-pipeline.yml
vendored
|
@ -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
15
Dockerfile
Normal 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"]
|
||||
|
Loading…
Reference in a new issue