Skip to content
Merged
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
25 changes: 19 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ services:
- 5432:5432
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 5s
timeout: 5s
retries: 5

redis:
image: redis:latest
Expand All @@ -31,8 +36,12 @@ services:
REDIS_HOST: ${REDIS_HOST}
REDIS_PORT: ${REDIS_PORT}
depends_on:
- db
- redis
db:
condition: service_healthy
redis:
condition: service_started
restart: on-failure
# if the API down in the timing when postgres is connecting, restart automatically

celery_worker:
build: .
Expand All @@ -45,8 +54,10 @@ services:
REDIS_HOST: ${REDIS_HOST}
REDIS_PORT: ${REDIS_PORT}
depends_on:
- db
- redis
db:
condition: service_healthy
redis:
condition: service_started
command: celery -A celery_app worker

celery_beat:
Expand All @@ -60,8 +71,10 @@ services:
REDIS_HOST: ${REDIS_HOST}
REDIS_PORT: ${REDIS_PORT}
depends_on:
- db
- redis
db:
condition: service_healthy
redis:
condition: service_started
command: celery -A celery_app beat

prometheus:
Expand Down
Loading