comfy/artel/docker-compose-prod.yml

102 wiersze
1.9 KiB
YAML

version: "3.8"
services:
db:
image: postgres
restart: always
environment:
- POSTGRES_ROOT_PASSWORD
- POSTGRES_USER
- POSTGRES_PASSWORD
- POSTGRES_DB
volumes:
- ../postgres/:/var/lib/postgresql
env_file:
- .env
networks:
- nginx_network
rabbit:
hostname: rabbit
image: rabbitmq:3.6.0
environment:
- RABBITMQ_DEFAULT_USER
- RABBITMQ_DEFAULT_PASS
ports:
- "5672:5672" # We forward this port because it's useful for debugging
- "15672:15672" # Here, we can access RabbitMQ management plugin
comfy:
build:
dockerfile: Dockerfile
context: ./
user: "${UID}:${GID}"
restart: always
ports:
- "8001:8000"
volumes:
- ./:/app
environment:
- SECRET_KEY
- DATABASE_URL
- DJANGO_SETTINGS_MODULE
env_file:
- .env
depends_on:
- db
networks:
- nginx_network
web:
image: nginx
restart: always
volumes:
- ../nginx/conf.d/:/etc/nginx/conf.d/
- ./static/:/opt/services/comfy/static
- ./media/:/opt/services/comfy/media
ports:
- "8000:80"
environment:
- NGINX_HOST=artel.tepewu.pl
- NGINX_PORT=80
networks:
- nginx_network
beat:
build:
context: .
dockerfile: Dockerfile
command: celery -A artel beat -l info --scheduler django_celery_beat.schedulers:DatabaseScheduler
volumes:
- ./:/app
env_file:
- .env
environment:
- SECRET_KEY
- DATABASE_URL
depends_on:
- comfy
- rabbit
worker:
build:
context: .
dockerfile: Dockerfile
command: celery -A artel worker -l info
volumes:
- ./:/app
- ./media:/app/media
env_file:
- .env
environment:
- SECRET_KEY
- DATABASE_URL
depends_on:
- comfy
- rabbit
- beat
networks:
nginx_network:
driver: bridge