HH/docker-compose.yml
ismail c5f76b3855
Some checks are pending
Build and Push Docker Image / build (push) Waiting to run
updates
2026-05-11 14:45:30 +03:00

105 lines
2.3 KiB
YAML

version: '3.8'
services:
db:
image: postgres:15-alpine
container_name: px360_db
volumes:
- postgres_data:/var/lib/postgresql/data
environment:
- POSTGRES_DB=px360
- POSTGRES_USER=px360
- POSTGRES_PASSWORD=px360
ports:
- "5433:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U px360"]
interval: 10s
timeout: 5s
retries: 5
redis:
image: redis:7-alpine
container_name: px360_redis
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
web:
build:
context: .
args:
UID: ${UID:-1000}
container_name: px360_web
environment:
- DATABASE_URL=postgresql://px360:px360@db:5432/px360
- DJANGO_SETTINGS_MODULE=config.settings.dev
command: >
sh -c "python manage.py migrate &&
python manage.py collectstatic --noinput || true &&
gunicorn config.wsgi:application --bind 0.0.0.0:8000 --workers 3 --reload"
volumes:
- .:/app
- media_volume:/app/media
ports:
- "8000:8000"
env_file:
- .env
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health/"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
celery:
build:
context: .
args:
UID: ${UID:-1000}
container_name: px360_celery
environment:
- DATABASE_URL=postgresql://px360:px360@db:5432/px360
- DJANGO_SETTINGS_MODULE=config.settings.dev
command: celery -A config worker -l info
volumes:
- .:/app
env_file:
- .env
depends_on:
- db
- redis
- web
celery-beat:
build:
context: .
args:
UID: ${UID:-1000}
container_name: px360_celery_beat
environment:
- DATABASE_URL=postgresql://px360:px360@db:5432/px360
- DJANGO_SETTINGS_MODULE=config.settings.dev
command: celery -A config beat -l info --scheduler django_celery_beat.schedulers:DatabaseScheduler
volumes:
- .:/app
env_file:
- .env
depends_on:
- db
- redis
- web
volumes:
postgres_data:
media_volume: