Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/backend-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ on:

jobs:
backend-docker-build-and-push:
# 🔧 임시: PR이 열리거나 업데이트될 때도 실행
if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'pull_request' }}
runs-on: ubuntu-latest

Expand Down Expand Up @@ -76,7 +75,7 @@ jobs:
backend-docker-pull-and-run:
runs-on: [ self-hosted, prod ]
needs: [ backend-docker-build-and-push ]
if: ${{ needs.backend-docker-build-and-push.result == 'success' && github.event.pull_request.merged == true }}
if: ${{ needs.backend-docker-build-and-push.result == 'success' && (github.event_name == 'workflow_dispatch' || github.event.pull_request.merged == true) }}

steps:
- name: ✨ Checkout repository
Expand Down
16 changes: 7 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,19 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-web'
runtimeOnly 'com.mysql:mysql-connector-j'
implementation 'org.springframework.boot:spring-boot-starter-actuator'

//Test
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
implementation 'org.springframework.boot:spring-boot-starter-actuator'

// H2 Database
// Database
runtimeOnly 'com.h2database:h2'
runtimeOnly 'org.postgresql:postgresql'

// Swagger
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.8.11'

// Security
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'io.jsonwebtoken:jjwt-api:0.13.0'
runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.13.0'
runtimeOnly 'io.jsonwebtoken:jjwt-jackson:0.13.0'

// Lombok
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
Expand All @@ -60,6 +56,8 @@ dependencies {
// Security
implementation 'org.springframework.boot:spring-boot-starter-security'
testImplementation "org.springframework.security:spring-security-test"

// JWT
implementation 'io.jsonwebtoken:jjwt-api:0.13.0'
runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.13.0'
runtimeOnly 'io.jsonwebtoken:jjwt-jackson:0.13.0'
Expand Down
2 changes: 1 addition & 1 deletion deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ fi
# 트래픽 전환 확인 (Nginx 기준 헬스체크)
echo "트래픽 전환 확인 중..."
sleep 5
NGINX_CHECK=$(curl -s --connect-timeout 5 http://127.0.0.1/api/health-check 2>/dev/null || echo "failed")
NGINX_CHECK=$(curl -s --connect-timeout 5 http://127.0.0.1/health-check 2>/dev/null || echo "failed")
if echo "${NGINX_CHECK}" | grep -q "OK"; then
echo "✅ 트래픽이 성공적으로 전환되었습니다."
else
Expand Down
106 changes: 53 additions & 53 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,53 +1,53 @@
# docker-compose.yml
version: '3.8'

services:
blue:
image: minibrb/linkiving-core:latest
container_name: blue
environment:
- LANG=ko_KR.UTF-8
- TZ=Asia/Seoul
ports:
- '8080:8080'
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:8080/health-check" ]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
restart: unless-stopped
networks:
- app-network
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"

green:
image: minibrb/linkiving-core:latest
container_name: green
environment:
- LANG=ko_KR.UTF-8
- TZ=Asia/Seoul
ports:
- '8081:8080'
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:8080/health-check" ]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
restart: unless-stopped
networks:
- app-network
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"

networks:
app-network:
driver: bridge
# docker-compose.yml
version: '3.8'
services:
blue:
image: linkivingsofa/core:latest
container_name: blue
environment:
- LANG=ko_KR.UTF-8
- TZ=Asia/Seoul
ports:
- '8080:8080'
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:8080/health-check" ]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
restart: unless-stopped
networks:
- app-network
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
green:
image: linkivingsofa/core:latest
container_name: green
environment:
- LANG=ko_KR.UTF-8
- TZ=Asia/Seoul
ports:
- '8081:8080'
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:8080/health-check" ]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
restart: unless-stopped
networks:
- app-network
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
networks:
app-network:
driver: bridge