Create Dockerfile

This commit is contained in:
Gidon Aniz 2023-12-17 20:37:31 +02:00 committed by GitHub
parent 0aa3adb56f
commit d6128202ab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

15
Dockerfile Normal file
View 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"]