services:
  mc:
    image: itzg/minecraft-server
    pull_policy: daily
    tty: true
    stdin_open: true
    user: "${UID}:${GID}"
    ports:
      - "${SERVER_PORT}:25565"
      - "${VOICE_CHAT_PORT}:24454/udp"
      - "${RCON_PORT}:25585"
      - "${BLUEMAP_PORT}:8100"
      - "${GEYSER_PORT}:19132/udp"
    environment:
      VERSION: "1.21.4"
      ANNOUNCE_PLAYER_ACHIEVEMENTS: false
      EULA: "TRUE"
      TYPE: PAPER
      PLUGINS:
      COPY_CONFIG_DEST: "/data"
      ONLINE_MODE: false
      RCON_PASSWORD: ${RCON_PASSWORD}
      RCON_PORT: ${RCON_PORT}
      MAX_MEMORY: "4G"
      SPAWN_PROTECTION: 0
      ENABLE_WHITELIST: true
    volumes:
      - ./mc-data:/data
      - ./mcserver:/config
      - ./plugins:/plugins
    restart: unless-stopped

  broadcaster:
    image: ghcr.io/mcxboxbroadcast/standalone:latest
    user: "${UID}:${GID}"
    depends_on:
      #proxy:
      #  condition: service_healthy
      mc:
        condition: service_healthy
    volumes:
      - ./mcxboxbroadcast/config:/opt/data/config
    restart: unless-stopped
