diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index d91188c..7cc2dd6 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -22,7 +22,7 @@ jobs: run: chmod +x ./gradlew working-directory: ./backend - - name: Build JAR with Gradle + - name: Build JAR without tests run: ./gradlew build -x test --no-daemon working-directory: ./backend diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 177a381..47c7d3b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,5 +25,5 @@ jobs: - name: Grant execute permission to Gradle wrapper run: chmod +x gradlew - - name: Build without tests + - name: Build JAR without tests run: ./gradlew build -x test --no-daemon diff --git a/backend/Dockerfile b/backend/Dockerfile index 8c9d99a..012449f 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -1,14 +1,10 @@ # backend/Dockerfile -# --- Stage 1: Build the JAR using Gradle --- -FROM gradle:7.6.0-jdk17 AS builder -WORKDIR /app -COPY . . -RUN gradle clean build -x test --no-daemon - -# --- Stage 2: Run the app using OpenJDK --- FROM openjdk:17-slim WORKDIR /app -COPY --from=builder /app/build/libs/*.jar app.jar + +# CI에서 빌드된 JAR을 그대로 사용 +COPY build/libs/*.jar app.jar + EXPOSE 80 ENTRYPOINT ["java", "-jar", "app.jar"]