version: '3.7'

services:

  rabbitmq:
    hostname: rabbitmq_host
    image: 'rabbitmq:3.8.18-management-alpine'
    container_name: first_rabbit
    env_file: config/.env
    restart: unless-stopped
    ports:
      - 8080:15672
      - 5672:5672

  worker:
    container_name: first_celery
    build: .
    command: celery --app=my_app:app_celery_instance worker --loglevel=INFO
    env_file: config/.env
    depends_on:
      - rabbitmq
    restart: unless-stopped

networks:
  default:
    name: celery_network
    driver: bridge

