Skip to content

Commit f2a59f9

Browse files
committed
add: api,batch,gateway를 위한 docker 환경설정
1 parent ab2cc50 commit f2a59f9

6 files changed

Lines changed: 35 additions & 16 deletions

File tree

.github/workflows/ci.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,3 @@ jobs:
4141
- name: Build Batch
4242
run: ./gradlew clean build
4343
working-directory: services/batch
44-
45-
# =========================
46-
# ✅ Gateway
47-
# =========================
48-
- name: Grant execute permission for Gateway gradlew
49-
run: chmod +x gradlew
50-
working-directory: services/gateway
51-
52-
- name: Build Gateway
53-
run: ./gradlew clean build
54-
working-directory: services/gateway

.idea/compiler.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docker-compose.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,18 @@ services:
2020
networks:
2121
- app-network
2222

23+
# 3. Batch (Spring Batch)
24+
batch:
25+
build:
26+
context: ./services/batch
27+
dockerfile: Dockerfile
28+
container_name: batch
29+
depends_on:
30+
- api
31+
networks:
32+
- app-network
33+
34+
2335
networks:
2436
app-network:
2537
driver: bridge

services/api/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
22
id 'java'
3-
id 'org.springframework.boot' version '4.0.1'
3+
id 'org.springframework.boot' version '3.4.1'
44
id 'io.spring.dependency-management' version '1.1.7'
55
}
66

@@ -25,7 +25,7 @@ repositories {
2525
}
2626

2727
dependencies {
28-
implementation 'org.springframework.boot:spring-boot-starter-webmvc'
28+
implementation 'org.springframework.boot:spring-boot-starter-web'
2929
compileOnly 'org.projectlombok:lombok'
3030
developmentOnly 'org.springframework.boot:spring-boot-devtools'
3131
annotationProcessor 'org.projectlombok:lombok'

services/batch/Dockerfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# 1️⃣ Build stage
2+
FROM gradle:8.7-jdk17 AS builder
3+
WORKDIR /app
4+
5+
# 소스 복사 (gradle 유저 권한 유지)
6+
COPY --chown=gradle:gradle . .
7+
8+
# 실행 권한 부여 및 gradlew로 빌드 (이게 더 에러가 적습니다)
9+
RUN chmod +x ./gradlew
10+
RUN ./gradlew bootJar -x test --no-daemon
11+
12+
# 2️⃣ Run stage
13+
FROM eclipse-temurin:17-jre
14+
WORKDIR /app
15+
16+
COPY --from=builder /app/build/libs/*.jar app.jar
17+
18+
ENTRYPOINT ["java", "-jar", "app.jar"]

services/batch/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
22
id 'java'
3-
id 'org.springframework.boot' version '4.0.1'
3+
id 'org.springframework.boot' version '3.4.1'
44
id 'io.spring.dependency-management' version '1.1.7'
55
}
66

@@ -26,7 +26,7 @@ repositories {
2626

2727
dependencies {
2828
implementation 'org.springframework.boot:spring-boot-starter-batch'
29-
implementation 'org.springframework.boot:spring-boot-starter-webmvc'
29+
implementation 'org.springframework.boot:spring-boot-starter-web'
3030
compileOnly 'org.projectlombok:lombok'
3131
developmentOnly 'org.springframework.boot:spring-boot-devtools'
3232
annotationProcessor 'org.projectlombok:lombok'

0 commit comments

Comments
 (0)