version: '3.8' services: db: image: postgres:15-alpine volumes: - postgres_data:/var/lib/postgresql/data environment: POSTGRES_DB: ${POSTGRES_DB:-credit_system_db} POSTGRES_USER: ${POSTGRES_USER:-postgres} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres} ports: - "5433:5432" healthcheck: test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres}"] interval: 10s timeout: 5s retries: 5 redis: image: redis:7-alpine ports: - "${REDIS_PORT:-6380}:6379" healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 10s timeout: 5s retries: 5 web: build: . command: python manage.py runserver 0.0.0.0:8000 volumes: - .:/app ports: - "8000:8000" env_file: - .env depends_on: db: condition: service_healthy redis: condition: service_healthy celery: build: . command: celery -A credit_system worker --loglevel=info volumes: - .:/app env_file: - .env depends_on: db: condition: service_healthy redis: condition: service_healthy volumes: postgres_data: