54 lines
1.0 KiB
YAML
54 lines
1.0 KiB
YAML
version: '3.9'
|
|
|
|
services:
|
|
|
|
postgres:
|
|
image: postgres:15
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data/
|
|
env_file:
|
|
- .env
|
|
ports:
|
|
- '5432:5432'
|
|
healthcheck:
|
|
test: [ "CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}" ]
|
|
interval: 10s
|
|
timeout: 60s
|
|
retries: 3
|
|
start_period: 10s
|
|
networks:
|
|
- app_network
|
|
|
|
celery:
|
|
build: ./app
|
|
command: celery -A project worker --autoscale=10,3 -l info
|
|
volumes:
|
|
- ./app:/home/app/web/
|
|
env_file:
|
|
- .env
|
|
depends_on:
|
|
redis:
|
|
condition: service_healthy
|
|
networks:
|
|
- app_network
|
|
redis:
|
|
container_name: redis
|
|
image: redis
|
|
restart: always
|
|
volumes:
|
|
- ./redis:/data
|
|
ports:
|
|
- "6379:6379"
|
|
healthcheck:
|
|
test: [ "CMD-SHELL", "redis-cli ping | grep PONG" ]
|
|
interval: 1s
|
|
timeout: 3s
|
|
retries: 5
|
|
networks:
|
|
- app_network
|
|
volumes:
|
|
postgres_data:
|
|
|
|
networks:
|
|
app_network:
|
|
driver: bridge |