services:
  minecraft-server:
    image: itzg/minecraft-server:latest
    container_name: minecraft-server
    ports:
      - 25565:25565
    environment:
      SERVER_NAME: "Minecraft Familie Voss"
      MOTD: "Forge Minecraft Server"
      EULA: "TRUE"
      TYPE: "FORGE"
      MODE: "survival"
      VERSION: "1.21.9"
      MEMORY: "2G"
      LEVEL_TYPE: "DEFAULT"
      ENABLE_RCON: "true"
      RCON_PASSWORD: Theodor22!
      RCON_PORT: 28016
      SERVER_PORT: 25565
      ENABLE_WHITELIST: "true"
      WHITELIST: "${WHITELISTED_PLAYERS}"
      OPS: "${OPS_PLAYERS}"
      MAX_PLAYERS: 20
      ANNOUNCE_PLAYER_ACHIEVEMENTS: "true"
      SPAWN_ANIMALS: "true"
      SPAWN_MONSTERS: "true"
      PVP: "true"
      LEVEL: "cold"
      TZ: "Europe/Berlin"
      GUI: "FALSE"
      MODS_FILE: /extras/mods.txt
      REMOVE_OLD_MODS: "true"
    restart: "unless-stopped"
    user: "${UID}:${GID}"
    volumes:
      - ./data:/data
      - ./mods.txt:/extras/mods.txt:ro
    logging:
      driver: "json-file"
      options:
        max-size: "1m"
