version: '3.4'
services:
  redis:
    image: redis
    ports:
      - "6379:6379"
    restart: always

  app:
    container_name: app
    build: .
    command: uvicorn main:app  --host 0.0.0.0 --port 8000 --reload
    volumes:
      - .:/app
      - /var/www/html/api/static:/app/static  # Mount the host static directory
    ports:
      - "8000:8000"
    restart: always
    depends_on:
      - redis
      
  app_clone:
    container_name: app_clone
    build: .
    command: uvicorn main:app --host 0.0.0.0 --port 8001
    volumes:
      - .:/app
      - /var/www/html/api/static:/app/static  # Mount the host static directory
    ports:
      - "8001:8001"
    restart: always
    depends_on:
      - redis

  celery_worker:
    container_name: celery_worker
    build: .
    command: celery -A celery_worker worker --pool=solo --loglevel=info
    volumes:
      - .:/app
    depends_on:
      - redis
      - app
