Multistage build

This commit is contained in:
Pranjal Kumar 2025-06-17 10:11:50 +05:30
parent 54f81c4b12
commit 147a8b4893
2 changed files with 6 additions and 7 deletions

View file

@ -39,9 +39,6 @@ jobs:
- name: Make Gradle executable
run: chmod +x ./gradlew
- name: Build App
run: ./gradlew build
docker_push:
name: Push to Docker Hub
runs-on: ubuntu-latest

View file

@ -1,8 +1,10 @@
FROM openjdk:17-jdk-slim
FROM gradle:8.10.2-jdk17 AS build
WORKDIR /app
COPY build/libs/*.jar app.jar
COPY . .
RUN gradle build --no-daemon
FROM eclipse-temurin:17-jdk
WORKDIR /app
COPY --from=build /app/build/libs/*.jar app.jar
EXPOSE 8080
ENTRYPOINT ["java", "-jar", "app.jar"]