version: "3"

networks:
  minecraft:
    driver: bridge
    name: minecraft
  grafana:
    external: true
  traefik:
    external: true

services:
  minecraft_creative:
    image: itzg/minecraft-server:latest
    container_name: minecraft_creative
    restart: unless-stopped
    networks:
      - grafana
      - minecraft
    ports:
      - "25566:25565"
      - "9226:9225"
    volumes:
      - /pwspool/games/minecraft/minecraft_creative:/data
    environment:
      - TYPE=PAPER
      - MEMORY=2G
      - VERSION=1.21.4
      - EULA=TRUE
      - SERVER_NAME=minecraft_creative
      - MODE=creative
      - DIFFICULTY=peaceful
      - OPS=RicecakeSMS,pZ_aeriaL
      - ENABLE_WHITELIST=true
      - WHITELIST=RicecakeSMS,pZ_aeriaL
      - ICON=https://i.imgur.com/sqjZGql.png
      - ENABLE_COMMAND_BLOCK=true
      - GENERATE_STRUCTURES=false
      - MOTD="\u00A77Pinnerland Creative Server, powered by \u00A75P\u00A79W\u00A75S\u00A77\!"
      - PVP=false
      - LEVEL_TYPE=FLAT
      - ALLOW_FLIGHT=true
    labels:
      - traefik.enable=false

  minecraft_2023:
    image: itzg/minecraft-server:latest
    container_name: minecraft_2023
    networks:
      - traefik
      - grafana
      - minecraft
    ports:
      - "25565:25565"
      - "9225:9225"
    volumes:
      - /pwspool/games/minecraft/minecraft_2023:/data
    environment:
      - TYPE=PAPER
      - MEMORY=4G
      - VERSION=1.21.4
      - EULA=TRUE
      - SERVER_NAME=minecraft_2023
      - MODE=survival
      - SPAWN_PROTECTION=0
      - DIFFICULTY=hard
      - OPS=RicecakeSMS,pZ_aeriaL
      - ENABLE_WHITELIST=true
      - WHITELIST=RicecakeSMS,pZ_aeriaL
      - ICON=https://i.imgur.com/sqjZGql.png
      - SEED="itsgoochfor2023"
      - MOTD="\u00A77Pinnerland, powered by \u00A75P\u00A79W\u00A75S\u00A77\!"
      - ALLOW_FLIGHT=false
    labels:
      - traefik.http.routers.minemap.rule=Host(`minemap.whitney.rip`)
      - traefik.http.routers.minemap.tls=true
      - traefik.http.routers.minemap.tls.certresolver=lets-encrypt
      - traefik.http.services.minemap.loadbalancer.server.port=8123
      - traefik.port=8123

  minecraft_skyblock:
    image: itzg/minecraft-server:latest
    container_name: minecraft_skyblock
    networks:
      - minecraft
    ports:
      - "25564:25565"
    volumes:
      - /pwspool/games/minecraft/minecraft_skyblock:/data
    environment:
      - TYPE=PAPER
      - MEMORY=4G
      - VERSION=1.21.4
      - EULA=TRUE
      - SERVER_NAME=minecraft_skyblock
      - MODE=survival
      - DIFFICULTY=hard
      - OPS=RicecakeSMS,pZ_aeriaL
      - ENABLE_WHITELIST=true
      - WHITELIST=RicecakeSMS,pZ_aeriaL
      - ICON=https://i.imgur.com/sqjZGql.png
      - MOTD="\u00A77Skyblock, powered by \u00A75P\u00A79W\u00A75S\u00A77\!"
    labels:
      - traefik.enable=false

  minecraft_2023_metrics:
    image: joshi425/minecraft_exporter:latest
    container_name: minecraft_2023_metrics
    networks:
      - minecraft
    ports:
      - 2565:2565
    volumes:
      - /pwspool/games/minecraft/minecraft_2023/world:/world
    environment:
      - RCON_HOST=127.0.0.1
      - RCON_PORT=25565
      - HTTP_PORT=25565
      - FORGE_SERVER="False"
      - PAPER_SERVER="True"
      - DYNMAP_ENABLED="True"
    labels:
      - traefik.enable=false
