mirror of
https://github.com/R0m1k3/podcastic.git
synced 2026-10-11 17:26:20 +02:00
chore: upgrade MongoDB to v8 and implement health checks for database services with conditional startup dependencies
This commit is contained in:
1 parent
34db9e2542
commit
b06298d80e
1 file changed
+16
-3
+16
-3
@@ -2,13 +2,19 @@ version: '3.8'
|
||||
|
||||
services:
|
||||
mongodb:
|
||||
image: mongo:7
|
||||
image: mongo:8
|
||||
container_name: podcastic-mongodb
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- mongodb_data:/data/db
|
||||
networks:
|
||||
- podcastic_net
|
||||
healthcheck:
|
||||
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
start_period: 20s
|
||||
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
@@ -18,6 +24,11 @@ services:
|
||||
- redis_data:/data
|
||||
networks:
|
||||
- podcastic_net
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "ping"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
app:
|
||||
build:
|
||||
@@ -38,8 +49,10 @@ services:
|
||||
PODCAST_INDEX_API_KEY: ${PODCAST_INDEX_API_KEY:-}
|
||||
PODCAST_INDEX_API_SECRET: ${PODCAST_INDEX_API_SECRET:-}
|
||||
depends_on:
|
||||
- mongodb
|
||||
- redis
|
||||
mongodb:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_healthy
|
||||
networks:
|
||||
- podcastic_net
|
||||
|
||||
|
||||
Reference in new issue
Block a user