services:
  mc:
    image: itzg/minecraft-server
    pull_policy: daily
    tty: true
    stdin_open: true
    user: "${UID}:${GID}"
    ports:
      - "25565:25565"
      - "24454:24454/udp"
      - "25585:25585"
      - "8100:8100"
      - "19132:19132/udp"
    environment:
      VERSION: "1.21.4"
      ANNOUNCE_PLAYER_ACHIEVEMENTS: false
      EULA: "TRUE"
      TYPE: PAPER
      PLUGINS: |
        #https://download.geysermc.org/v2/projects/floodgate/versions/latest/builds/latest/downloads/spigot
        #https://download.geysermc.org/v2/projects/geyser/versions/latest/builds/latest/downloads/spigot
        https://github.com/SkinsRestorer/SkinsRestorer/releases/latest/download/SkinsRestorer.jar
        https://github.com/oddlama/vane/releases/download/v1.18.0/vane-core-1.18.0.jar
        #https://github.com/oddlama/vane/releases/download/v1.18.0/vane-permissions-1.18.0.jar
        https://github.com/oddlama/vane/releases/download/v1.18.0/vane-trifles-1.18.0.jar
        https://github.com/oddlama/vane/releases/download/v1.18.0/vane-admin-1.18.0.jar
        #https://github.com/oddlama/vane/releases/download/v1.18.0/vane-bedtime-1.18.0.jar
        https://github.com/BlueMap-Minecraft/BlueMap/releases/download/v5.7/bluemap-5.7-paper.jar
        https://github.com/froobynooby/SeeMore/releases/download/v1.0.2/SeeMore-1.0.2.jar
        #https://github.com/ViaVersion/ViaVersion/releases/download/5.3.2/ViaVersion-5.3.2.jar
        #https://github.com/ViaVersion/ViaBackwards/releases/download/5.3.2/ViaBackwards-5.3.2.jar
        #https://github.com/ViaVersion/ViaRewind/releases/download/4.0.7/ViaRewind-4.0.7.jar
        #https://github.com/4drian3d/AuthMeVelocity/releases/download/4.1.2/AuthMeVelocity-Paper-4.1.2.jar
        #https://github.com/AuthMe/AuthMeReloaded/releases/download/5.6.0/AuthMe-5.6.0.jar
        #https://github.com/TuxCoding/FastLogin/releases/download/1.12-kick-toggle/FastLoginBukkit.jar
      COPY_CONFIG_DEST: "/data"
      ONLINE_MODE: false
      RCON_PASSWORD: ${RCON_PASSWORD}
      RCON_PORT: 25585
      MAX_MEMORY: "8G"
      SPAWN_PROTECTION: 0
      ENABLE_WHITELIST: true
    volumes:
      - ./mc-data:/data
      - ./mcserver:/config
      - ./plugins:/plugins
    restart: unless-stopped

  broadcaster:
    build:
      context: ./mcxboxbroadcast
      dockerfile: Dockerfile
    user: "${UID}:${GID}"
    depends_on:
      #proxy:
      #  condition: service_healthy
      mc:
        condition: service_healthy
    volumes:
      - ./broadcast-data:/app
    restart: unless-stopped
