File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # VCS
12.git
2- .gradle
3+ .gitignore
4+ .gitattributes
5+ .github /
6+
7+ # Gradle 로컬 캐시 / 빌드 산출물 (컨테이너 안에서 다시 생성되므로 불필요)
8+ .gradle /
39build /
4- * .md
10+ out /
11+ bin /
12+ HELP.md
13+
14+ # IDE / OS 자동 생성 파일
15+ .idea /
16+ .vscode /
17+ .settings /
18+ .classpath
19+ .project
20+ .springBeans
21+ .sts4-cache
22+ .apt_generated
23+ .factorypath
24+ * .iml
25+ * .iws
26+ * .ipr
27+ ** /.DS_Store
28+ Thumbs.db
29+
30+ # 환경변수 / 시크릿
531.env
6- .idea
32+ .env. *
33+ ! .env.example
34+ * .pem
35+ * .key
36+ id_rsa *
37+
38+ # Docker / Compose 정의 (이미지 안에서 안 씀)
39+ Dockerfile
40+ .dockerignore
41+ docker /
42+ docker-compose * .yml
43+ compose * .yaml
44+ compose * .yml
45+
46+ # 배포 인프라 정의 (fluent-bit 설정 등)
47+ deploy /
48+
49+ # 문서
50+ * .md
51+ LICENSE
52+ docs /
53+ CLAUDE.md
54+
55+ # 테스트 코드 (Dockerfile이 `gradlew build -x test`로 스킵하므로 제외)
56+ src /test /
57+
58+ # 로컬 실행 흔적 (데이터/로그)
59+ postgres-data /
60+ logs /
61+ * .log
62+
63+ # Windows 전용 스크립트 (리눅스 컨테이너 무관)
64+ gradlew.bat
Original file line number Diff line number Diff line change 1212 deploy :
1313 name : Deploy to Wisoft Server
1414 runs-on : ubuntu-latest
15- if : ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'push' }}
15+ if : ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'push' && github.event.workflow_run.head_branch == 'main' }}
1616
1717 steps :
1818 - name : SSH 키 설정
@@ -49,10 +49,10 @@ jobs:
4949 echo "$GHCR_PAT" | docker login ghcr.io -u "$GITHUB_ACTOR" --password-stdin
5050
5151 echo "=== 최신 이미지 Pull ==="
52- docker compose -f docker/docker -compose.prod.yml --env-file .env pull app
52+ docker compose -f docker-compose.prod.yml pull app
5353
5454 echo "=== 앱 컨테이너 재시작 ==="
55- docker compose -f docker/docker -compose.prod.yml --env-file .env up -d app
55+ docker compose -f docker-compose.prod.yml up -d app
5656
5757 echo "=== Health Check (최대 60초) ==="
5858 for i in \$(seq 1 12); do
6565 done
6666
6767 echo "Health check 실패"
68- docker compose -f docker/docker -compose.prod.yml logs --tail=50 app
68+ docker compose -f docker-compose.prod.yml logs --tail=50 app
6969 exit 1
7070 ENDSSH
7171
Original file line number Diff line number Diff line change @@ -5,16 +5,13 @@ FROM eclipse-temurin:21 AS builder
55
66WORKDIR /app
77
8- # Gradle 캐싱을 위해 설정 파일 먼저 복사
98COPY gradlew .
109COPY gradle gradle
11- COPY build.gradle .
1210COPY settings.gradle .
11+ COPY build.gradle .
1312
14- # 의존성 다운로드 (캐싱 레이어)
1513RUN ./gradlew dependencies --no-daemon
1614
17- # 소스코드 복사 후 빌드
1815COPY src src
1916RUN ./gradlew build -x test --no-daemon
2017
@@ -29,12 +26,9 @@ RUN apt-get update && apt-get install -y ffmpeg curl && rm -rf /var/lib/apt/list
2926
3027COPY --from=builder /app/build/libs/*.jar app.jar
3128
32- # 포트 문서화
3329EXPOSE 7300
3430
35- # 컨테이너 레벨 헬스체크 (Docker daemon의 status 표시용)
36- HEALTHCHECK --interval=24h --timeout=10s --start-period=40s --retries=3 \
37- CMD curl -sf http://localhost:7300/actuator/health || exit 1
31+ HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
32+ CMD curl -sf http://localhost:7300/actuator/health
3833
39- # 실행
4034ENTRYPOINT ["java" , "-jar" , "app.jar" ]
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ services :
2+ postgres :
3+ image : postgres:17
4+ container_name : prepair-backend-java-postgres
5+ ports :
6+ - " ${POSTGRES_PORT}:5432"
7+ environment :
8+ - POSTGRES_DB=${POSTGRES_DB}
9+ - POSTGRES_USER=${POSTGRES_USER}
10+ - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
11+ volumes :
12+ - postgres-data:/var/lib/postgresql/data
13+ healthcheck :
14+ test : ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER}"]
15+ interval : 10s
16+ timeout : 5s
17+ retries : 5
18+
19+ app :
20+ build :
21+ context : .
22+ dockerfile : Dockerfile
23+ container_name : prepair-backend-java-api
24+ ports :
25+ - " 7300:7300"
26+ env_file :
27+ - .env
28+ environment :
29+ - SPRING_PROFILES_ACTIVE=prod
30+ - TZ=Asia/Seoul
31+ depends_on :
32+ postgres :
33+ condition : service_healthy
34+
35+ volumes :
36+ postgres-data :
37+
38+
39+
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments