services:
  management-frontend:
    container_name: ragflowplus-management-frontend
    image: zstar1003/ragflowplus-management-web:v0.3.0
    build:
      context: .
      dockerfile: Dockerfile
      target: frontend
    ports:
      - "8888:80"
    depends_on:
      - management-backend
    environment:
      - API_BASE_URL=/api 
    networks:
      - management_network

  management-backend:
    container_name: ragflowplus-management-backend
    image: zstar1003/ragflowplus-management-server:v0.3.0
    build:
      context: .
      dockerfile: Dockerfile
      target: backend
    ports:
      - "5000:5000"
    environment:
      - FLASK_ENV=development
      - CORS_ALLOWED_ORIGINS=http://frontend
      - MANAGEMENT_ADMIN_USERNAME=${MANAGEMENT_ADMIN_USERNAME:-admin}
      - MANAGEMENT_ADMIN_PASSWORD=${MANAGEMENT_ADMIN_PASSWORD:-12345678}
      - MANAGEMENT_JWT_SECRET=${MANAGEMENT_JWT_SECRET:-12345678}
    extra_hosts:
      - "host.docker.internal:host-gateway"
    networks:
      - management_network

networks:
  management_network:
    driver: bridge