Skip to content

Commit 0f74a8e

Browse files
committed
[Fix]:빌드 방식 수정
1 parent d155439 commit 0f74a8e

File tree

2 files changed

+15
-21
lines changed

2 files changed

+15
-21
lines changed

.github/workflows/deploy.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,18 @@ jobs:
5959
- name: Checkout code
6060
uses: actions/checkout@v4
6161

62+
- name: Set up JDK 21
63+
uses: actions/setup-java@v3
64+
with:
65+
java-version: '21'
66+
distribution: 'temurin'
67+
68+
- name: Setup Gradle
69+
uses: gradle/gradle-build-action@v2
70+
71+
- name: Build with Gradle
72+
run: ./gradlew clean bootJar -x test --no-daemon
73+
6274
- name: Set environment
6375
id: env
6476
run: |

Dockerfile

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,4 @@
1-
# Build stage
2-
FROM gradle:8.5-jdk21 AS builder
3-
4-
WORKDIR /app
5-
6-
# Copy Gradle files
7-
COPY build.gradle.kts settings.gradle.kts ./
8-
COPY gradle gradle
9-
10-
# Download dependencies
11-
RUN gradle dependencies --no-daemon || true
12-
13-
# Copy source code
14-
COPY src ./src
15-
16-
# Build application
17-
RUN gradle clean build -x test --no-daemon
18-
19-
# Runtime stage
1+
# Runtime stage only
202
FROM eclipse-temurin:21-jre-alpine
213

224
WORKDIR /app
@@ -31,8 +13,8 @@ ENV PG_TOSS_SECRET_KEY=${PG_TOSS_SECRET_KEY}
3113
RUN addgroup -S spring && adduser -S spring -G spring
3214
USER spring:spring
3315

34-
# Copy built jar from builder
35-
COPY --from=builder /app/build/libs/*.jar app.jar
16+
# Copy pre-built jar from local build
17+
COPY build/libs/backend-0.0.1-SNAPSHOT.jar app.jar
3618

3719
# Expose port
3820
EXPOSE 8080

0 commit comments

Comments
 (0)