Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- version: '3.7'
- volumes:
- app-volume:
- postgres_data: {}
- x-app: &app
- build:
- context: .
- dockerfile: Dockerfile
- image: app
- volumes:
- - .:/collector
- depends_on:
- - postgres
- - redis
- services:
- postgres:
- image: postgres:latest
- restart: unless-stopped
- volumes:
- - postgres_data:/var/lib/postgresql/data
- environment:
- POSTGRES_DB: collector_db
- POSTGRES_USER: collector
- POSTGRES_PASSWORD: 1234
- ports:
- - 5432:5432
- nginx:
- build: ./nginx
- ports:
- - 8000:8000
- volumes:
- - app-volume:/collector/static/
- depends_on:
- - app
- app:
- <<: *app
- command: gunicorn --bind 0.0.0.0:8000 -w 1 -n collector collector.wsgi
- volumes:
- - app-volume:/collector/static/
- expose:
- - 8000
- depends_on:
- - postgres
- - redis
- migration:
- <<: *app
- command: python manage.py migrate
- depends_on:
- - app
- celery_worker:
- <<: *app
- command: celery -A collector worker -l error --concurrency=20 -n worker1@%h
- depends_on:
- - app
- celery_worker_2:
- <<: *app
- command: celery -A collector worker -l error --concurrency=20 -n worker2@%h
- depends_on:
- - app
- celery_beat:
- <<: *app
- command: celery -A collector beat -l info
- depends_on:
- - app
- flower:
- <<: *app
- command: celery flower -A collector --address=0.0.0.0 --port=5555
- ports:
- - 5555:5555
- depends_on:
- - app
- redis:
- image: redis:5.0.3-alpine
- restart: unless-stopped
- ports:
- - 6379:6379
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement