version: '3.9' services: web: image: repcofkk:latest build: ./app command: sh -c " python manage.py makemigrations --noinput && python manage.py migrate --noinput && gunicorn --workers=2 --config gunicorn.conf.py repcofkk.wsgi:application --bind 0.0.0.0:8000 " ports: - '8000:8000' expose: - 8000 env_file: - .env depends_on: postgres: condition: service_healthy volumes: - ./app/static:/home/app/web/static/ - ./app:/home/app/web/ restart: always nginx: build: ./nginx/dev volumes: - ./app/static/:/home/app/web/static/ ports: - "80:80" - "443:443" depends_on: web: condition: service_started restart: always celery: image: repcofkk:latest build: ./app command: celery -A repcofkk worker --autoscale=10,3 -l info volumes: - ./app:/home/app/web/ env_file: - .env depends_on: postgres: condition: service_healthy redis: condition: service_started restart: always celery-beat: image: repcofkk:latest command: celery -A repcofkk beat -l info volumes: - ./app:/home/app/web/ env_file: - .env depends_on: postgres: condition: service_healthy redis: condition: service_started restart: always redis: container_name: redis image: redis volumes: - ./redis:/data ports: - "6379:6379" healthcheck: test: [ "CMD-SHELL", "redis-cli ping | grep PONG" ] interval: 1s timeout: 3s retries: 5 restart: always postgres: image: postgres:12 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 flower: image: mher/flower ports: - "5555:5555" command: celery flower --broker=redis://redis:6379/0 depends_on: celery: condition: service_started environment: - CELERY_BROKER_URL=redis://redis:6379/0 restart: always volumes: postgres_data: