version: "3.8"

services:
  backend:
    build: ./backend
    command: uvicorn app.main:app --host 0.0.0.0 --port 8888
    ports:
      - "8888:8888"
    volumes:
      - ./backend:/app
      - YakPanel-server-data:/app/data
    environment:
      - REDIS_URL=redis://redis:6379/0
      - DATABASE_URL=sqlite+aiosqlite:///./data/default.db
    depends_on:
      - redis

  celery:
    build: ./backend
    command: celery -A app.tasks.celery_app worker -l info
    volumes:
      - ./backend:/app
    environment:
      - REDIS_URL=redis://redis:6379/0
    depends_on:
      - redis

  redis:
    image: redis:7-alpine
    ports:
      - "6379:6379"

  frontend:
    build:
      context: ./frontend
      dockerfile: Dockerfile
    ports:
      - "5173:80"
    depends_on:
      - backend

volumes:
  YakPanel-server-data:
