mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-21 23:35:50 +00:00
Create Dockerfile
This commit is contained in:
parent
0aa3adb56f
commit
d6128202ab
1 changed files with 15 additions and 0 deletions
15
Dockerfile
Normal file
15
Dockerfile
Normal file
|
@ -0,0 +1,15 @@
|
|||
# Step 1: Run SonarQube to check the code
|
||||
FROM sonarqube:latest AS sonarqube
|
||||
# Customize SonarQube settings if needed
|
||||
|
||||
# Step 2: Build the artifact
|
||||
FROM maven:3.8.4-openjdk-8 AS builder
|
||||
COPY . /app
|
||||
WORKDIR /app
|
||||
RUN mvn clean package
|
||||
|
||||
# Step 3: Create the final image
|
||||
FROM openjdk:8-jre-alpine
|
||||
COPY --from=builder /app/target/*.jar /code/
|
||||
WORKDIR /code
|
||||
CMD ["java", "-jar", "*.jar"]
|
Loading…
Reference in a new issue