Skip to content

Commit be22831

Browse files
committed
fix healthchecks
1 parent 579abc3 commit be22831

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

‎docker-compose.prod.yml‎

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ services:
1515
- caddy_config:/config
1616
depends_on:
1717
api:
18-
condition: service_healthy
18+
condition: service_started
1919
frontend:
20-
condition: service_healthy
20+
condition: service_started
2121
deploy:
2222
resources:
2323
limits:
@@ -132,6 +132,12 @@ services:
132132
- QDRANT_URL=http://qdrant:6333
133133
- ENVIRONMENT=production
134134
command: python -m workers.main
135+
healthcheck:
136+
test: ["CMD", "python", "-c", "import redis; r=redis.from_url('redis://redis:6379'); r.ping()"]
137+
interval: 30s
138+
timeout: 5s
139+
retries: 3
140+
start_period: 10s
135141
deploy:
136142
resources:
137143
limits:
@@ -149,6 +155,12 @@ services:
149155
- NEXTAUTH_URL=${NEXTAUTH_URL}
150156
- NEXTAUTH_SECRET=${NEXTAUTH_SECRET}
151157
- NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL}
158+
healthcheck:
159+
test: ["CMD", "node", "-e", "fetch('http://localhost:3000').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"]
160+
interval: 30s
161+
timeout: 5s
162+
retries: 3
163+
start_period: 10s
152164
deploy:
153165
resources:
154166
limits:

0 commit comments

Comments
 (0)