version: '3.8'

services:
  bot-panel:
    build: .
    container_name: bot-management-panel
    restart: unless-stopped
    ports:
      - "5001:5001"
    environment:
      - NODE_ENV=production
      - DOMAIN=betclas.net
      - PORT=5001
      - BOT_CONFIGS_PATH=/home/root1/betclas.net
    volumes:
      - /home/root1/betclas.net:/home/root1/betclas.net:ro
      - ./logs:/app/logs
      - /var/log:/var/log:ro
    networks:
      - bot-network
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.bot-panel.rule=Host(`betclas.net`)"
      - "traefik.http.routers.bot-panel.entrypoints=websecure"
      - "traefik.http.routers.bot-panel.tls.certresolver=letsencrypt"
      - "traefik.http.services.bot-panel.loadbalancer.server.port=5001"

  # Nginx reverse proxy (alternative to Traefik)
  nginx:
    image: nginx:alpine
    container_name: bot-panel-nginx
    restart: unless-stopped
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./nginx.conf:/etc/nginx/nginx.conf:ro
      - ./ssl:/etc/nginx/ssl:ro
    depends_on:
      - bot-panel
    networks:
      - bot-network

networks:
  bot-network:
    driver: bridge
