bot_procedures/docker-compose.yaml
2024-08-16 11:19:39 +03:00

58 lines
1.0 KiB
YAML

version: '3'
services:
redis:
image: redis
ports:
- '6379:6379'
db:
image: postgres
env_file:
- .env
environment:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_HOST: 'db'
POSTGRES_PORT: '5432'
POSTGRES_USER: ${USER_DATABASES}
POSTGRES_PASSWORD: ${PASSWORD_DATABASES}
volumes:
- ./postgres_data:/var/lib/postgresql/data/
ports:
- '5432:5432'
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
interval: 10s
timeout: 10s
retries: 5
app:
build: .
tty: true
command: sh -c "python manage.py migrate && python manage.py runserver 0.0.0.0:8000"
ports:
- '8000:8000'
depends_on:
db:
condition: service_healthy
volumes:
- .:/app
celery:
build: .
tty: true
command: celery -A config worker -l INFO
depends_on:
- redis
- app
celery_beat:
build: .
tty: true
command: celery -A config beat -l INFO -S django
depends_on:
- redis
- app
volumes:
pg_data: