services:
  velocity:
    image: itzg/mc-proxy:java21
    container_name: debug-velocity
    ports:
      - "25577:25577"
    volumes:
      - lunatic-debug-velocity-data:/server
      - ./plugins-velocity:/server/plugins
      - ./velocity.toml:/server/velocity.toml
    environment:
      TYPE: "VELOCITY"
      MEMORY: "512M"
      ONLINE_MODE: "false"
    depends_on:
      s1:
        condition: service_healthy
      s2:
        condition: service_healthy
    healthcheck:
      test: mc-health
      start_period: 60s
      interval: 10s
      timeout: 5s
      retries: 3
    networks:
      - minecraft-network

  s1:
    image: itzg/minecraft-server:java21
    container_name: debug-server-s1
    expose:
      - "25565"
    ports:
      - "25575:25575"
    volumes:
      - lunatic-debug-s1-data:/data
      - ./plugins-paper-s1:/data/plugins
      - ./bukkit.yml:/data/bukkit.yml
    environment:
      EULA: "TRUE"
      TYPE: "PAPER"
      VERSION: "1.21.11"
      MEMORY: "1G"

      # デバッグ用高速化設定
      LEVEL_TYPE: "flat"
      VIEW_DISTANCE: "3"
      SIMULATION_DISTANCE: "3"
      GENERATE_STRUCTURES: "false"
      SPAWN_PROTECTION: "0"
      ALLOW_NETHER: "false"

      # 権限関連
      OVERRIDE_SERVER_PROPERTIES: "true"

      ENABLE_RCON: "true"
      RCON_PASSWORD: "minecraft"
      RCON_PORT: 25575

      DIFFICULTY: "peaceful"
      MAX_PLAYERS: "3"
      ONLINE_MODE: "false"
      SYNC_SKIP_NEWER_IN_DESTINATION: "false"
    networks:
      - minecraft-network
    healthcheck:
      test: mc-health
      start_period: 60s
      interval: 10s
      timeout: 5s
      retries: 3
    tty: true
    stdin_open: true

  s2:
    image: itzg/minecraft-server:java21
    container_name: debug-server-s2
    expose:
      - "25565"
    ports:
      - "25576:25575"
    volumes:
      - lunatic-debug-s2-data:/data
      - ./plugins-paper-s2:/data/plugins
      - ./bukkit.yml:/data/bukkit.yml
    environment:
      EULA: "TRUE"
      TYPE: "PAPER"
      VERSION: "1.21.11"
      MEMORY: "1G"

      # デバッグ用高速化設定
      LEVEL_TYPE: "flat"
      VIEW_DISTANCE: "3"
      SIMULATION_DISTANCE: "3"
      GENERATE_STRUCTURES: "false"
      SPAWN_PROTECTION: "0"
      ALLOW_NETHER: "false"

      # 権限関連
      OVERRIDE_SERVER_PROPERTIES: "true"

      ENABLE_RCON: "true"
      RCON_PASSWORD: "minecraft"
      RCON_PORT: 25575

      DIFFICULTY: "peaceful"
      MAX_PLAYERS: "3"
      ONLINE_MODE: "false"
      SYNC_SKIP_NEWER_IN_DESTINATION: "false"
    networks:
      - minecraft-network
    healthcheck:
      test: mc-health
      start_period: 60s
      interval: 10s
      timeout: 5s
      retries: 3
    tty: true
    stdin_open: true

networks:
  minecraft-network:
    driver: bridge

volumes:
  lunatic-debug-s1-data:
  lunatic-debug-s2-data:
  lunatic-debug-velocity-data:
