version: '3.8'

services:
  wled-controller:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: wled-screen-controller
    restart: unless-stopped

    ports:
      - "8080:8080"

    volumes:
      # Persist device data
      - ./data:/app/data
      # Persist logs
      - ./logs:/app/logs
      # Mount configuration (optional override)
      - ./config:/app/config
      # Required for screen capture on Linux
      - /tmp/.X11-unix:/tmp/.X11-unix:ro

    environment:
      # Server configuration
      - WLED_SERVER__HOST=0.0.0.0
      - WLED_SERVER__PORT=8080
      - WLED_SERVER__LOG_LEVEL=INFO

      # Display for X11 (Linux only)
      - DISPLAY=${DISPLAY:-:0}

      # Processing defaults
      - WLED_PROCESSING__DEFAULT_FPS=30
      - WLED_PROCESSING__BORDER_WIDTH=10

    # Use host network for screen capture access
    # network_mode: host  # Uncomment for Linux screen capture

    networks:
      - wled-network

networks:
  wled-network:
    driver: bridge
