86 lines
1.8 KiB
YAML
86 lines
1.8 KiB
YAML
version: '3.9'
|
|
|
|
services:
|
|
web:
|
|
build: ./app
|
|
image: cyber_fitness_bot:latest
|
|
command: >
|
|
sh -c "
|
|
python manage.py makemigrations --noinput &&
|
|
python manage.py migrate --noinput &&
|
|
gunicorn --workers=2 project.wsgi:application --bind 0.0.0.0:8000
|
|
"
|
|
ports:
|
|
- "127.0.0.1:8000:8000"
|
|
env_file:
|
|
- .env
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
volumes:
|
|
- ./app/logs:/home/app/web/logs
|
|
- ./app/media:/home/app/web/media
|
|
restart: always
|
|
|
|
|
|
redis:
|
|
container_name: redis
|
|
image: redis
|
|
restart: always
|
|
volumes:
|
|
- redis_data:/data
|
|
# ports:
|
|
# - "6379:6379"
|
|
healthcheck:
|
|
test: [ "CMD-SHELL", "redis-cli ping | grep PONG" ]
|
|
interval: 1s
|
|
timeout: 3s
|
|
retries: 5
|
|
|
|
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
|
|
restart: always
|
|
celery:
|
|
image: cyber_fitness_bot:latest
|
|
command: celery -A project worker --autoscale=10,3 -l info
|
|
env_file:
|
|
- .env
|
|
volumes:
|
|
- ./app/logs:/home/app/web/logs
|
|
- ./app/media:/home/app/web/media
|
|
depends_on:
|
|
redis:
|
|
condition: service_started
|
|
web:
|
|
condition: service_started
|
|
restart: always
|
|
|
|
|
|
celery-beat:
|
|
image: cyber_fitness_bot:latest
|
|
command: celery -A project beat -l info
|
|
env_file:
|
|
- .env
|
|
depends_on:
|
|
redis:
|
|
condition: service_started
|
|
web:
|
|
condition: service_started
|
|
restart: always
|
|
|
|
volumes:
|
|
postgres_data:
|
|
redis_data:
|