Add docker image build
This commit is contained in:
13
SmartClinicManagementSystem/app/Dockerfile
Normal file
13
SmartClinicManagementSystem/app/Dockerfile
Normal file
@@ -0,0 +1,13 @@
|
||||
# Step 1: Use Maven with JDK 21 to build the app
|
||||
FROM gradle:8.14.3-jdk21-alpine AS builder
|
||||
WORKDIR /app
|
||||
COPY build.gradle .
|
||||
COPY src ./src
|
||||
RUN gradle clean bootJar -DskipTests
|
||||
|
||||
# Step 2: Use lightweight JRE 21 for running the app
|
||||
FROM eclipse-temurin:21-jre-alpine-3.22
|
||||
WORKDIR /app
|
||||
COPY --from=builder /app/build/libs/app-1.0.0.jar app.jar
|
||||
EXPOSE 8080
|
||||
ENTRYPOINT ["java", "-jar", "app.jar"]
|
||||
Reference in New Issue
Block a user