Skip to content

Commit 4b1247f

Browse files
bluebamusclaude
andcommitted
fix(compose): app healthcheck + webserver depends_on service_healthy 추가 (Phase 2 F)
healthcheck 단계 실패(app 이 healthy 로 전환 못 함, static 10건) 해결. devspoon-web 정본 패턴을 5개 웹 스택에 추가. - app 서비스(gunicorn/uvicorn/uwsgi/daphne-app:8000, php-app:9000): healthcheck test `bash -c '</dev/tcp/127.0.0.1/<port>'` (bash 내장, 추가 의존성 없음) - webserver: depends_on <app> condition: service_healthy (앱 부팅 전 502 race 차단) WSL verify_healthcheck: STATIC_FAIL=0, RUNTIME_PASS=12 (php-app healthy 도달) 통과. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 8c0634c commit 4b1247f

5 files changed

Lines changed: 45 additions & 0 deletions

File tree

‎compose/web_service/nginx_daphne/docker-compose.yml‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ services:
2424
environment:
2525
TZ: "Asia/Seoul"
2626
restart: always
27+
depends_on:
28+
daphne-app:
29+
condition: service_healthy
2730

2831
daphne-app:
2932
build: ../../../docker/gunicorn/
@@ -69,6 +72,12 @@ services:
6972
environment:
7073
TZ: "Asia/Seoul"
7174
restart: always
75+
healthcheck:
76+
test: ["CMD-SHELL", "bash -c '</dev/tcp/127.0.0.1/8000' || exit 1"]
77+
interval: 10s
78+
timeout: 3s
79+
retries: 5
80+
start_period: 30s
7281

7382
celery:
7483
build: ../../../docker/gunicorn/

‎compose/web_service/nginx_gunicorn/docker-compose.yml‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ services:
2424
environment:
2525
TZ: "Asia/Seoul"
2626
restart: always
27+
depends_on:
28+
gunicorn-app:
29+
condition: service_healthy
2730

2831
gunicorn-app:
2932
build: ../../../docker/gunicorn/
@@ -44,6 +47,12 @@ services:
4447
environment:
4548
TZ: "Asia/Seoul"
4649
restart: always
50+
healthcheck:
51+
test: ["CMD-SHELL", "bash -c '</dev/tcp/127.0.0.1/8000' || exit 1"]
52+
interval: 10s
53+
timeout: 3s
54+
retries: 5
55+
start_period: 30s
4756

4857
celery:
4958
build: ../../../docker/gunicorn/

‎compose/web_service/nginx_php/docker-compose.yml‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ services:
2424
environment:
2525
TZ: "Asia/Seoul"
2626
restart: always
27+
depends_on:
28+
php-app:
29+
condition: service_healthy
2730

2831
php-app:
2932
build: ../../../docker/php-fpm/
@@ -43,6 +46,12 @@ services:
4346
environment:
4447
TZ: "Asia/Seoul"
4548
restart: always
49+
healthcheck:
50+
test: ["CMD-SHELL", "bash -c '</dev/tcp/127.0.0.1/9000' || exit 1"]
51+
interval: 10s
52+
timeout: 3s
53+
retries: 5
54+
start_period: 30s
4655

4756
redis:
4857
image: redis:latest

‎compose/web_service/nginx_uvicorn/docker-compose.yml‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ services:
2424
environment:
2525
TZ: "Asia/Seoul"
2626
restart: always
27+
depends_on:
28+
uvicorn-app:
29+
condition: service_healthy
2730

2831
uvicorn-app:
2932
build: ../../../docker/gunicorn/
@@ -44,6 +47,12 @@ services:
4447
environment:
4548
TZ: "Asia/Seoul"
4649
restart: always
50+
healthcheck:
51+
test: ["CMD-SHELL", "bash -c '</dev/tcp/127.0.0.1/8000' || exit 1"]
52+
interval: 10s
53+
timeout: 3s
54+
retries: 5
55+
start_period: 30s
4756

4857
celery:
4958
build: ../../../docker/gunicorn/

‎compose/web_service/nginx_uwsgi/docker-compose.yml‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ services:
2424
environment:
2525
TZ: "Asia/Seoul"
2626
restart: always
27+
depends_on:
28+
uwsgi-app:
29+
condition: service_healthy
2730

2831
uwsgi-app:
2932
build: ../../../docker/uwsgi/
@@ -44,6 +47,12 @@ services:
4447
environment:
4548
TZ: "Asia/Seoul"
4649
restart: always
50+
healthcheck:
51+
test: ["CMD-SHELL", "bash -c '</dev/tcp/127.0.0.1/8000' || exit 1"]
52+
interval: 10s
53+
timeout: 3s
54+
retries: 5
55+
start_period: 30s
4756

4857
celery:
4958
build: ../../../docker/uwsgi/

0 commit comments

Comments
 (0)