Automate Bungeecord Proxy with Docker Event Listeners

Discussion in 'Spigot Plugin Development' started by Muehre, Aug 8, 2018.

  1. Hey Folks!

    I developed a plugin for the Bungeecord Proxy and I am thinking about to open source it and give the Community access ;)

    Yes it's about Docker and Clouding Technologies. (If you do now know what Docker or Visualization is, you should stop reading now).

    I got the basic idea after using docker-gen which is a reverse proxy that automatically generates a nginx config for containers based on their environment. i.e starting a container with VIRTUAL_HOST=mydomain.tld will add an entry + upstream to nginx using the IP from the connected network. (It also supports letsencrypt and much more, worth a look!)

    My basic idea was: Why not doing the same for the Bungeecord Proxy?

    My plugin allows the following:

    Docker event Listener

    By running i.e.:
    docker run -d -t -i \
    -e SERVER_NAME='lobby-1' \
    -e SERVER_PORT='12345' \
    -e SERVER_TYPE='spigot' \
    -e SERVER_MOTD='A Minecraft Server' \
    -e SERVER_GROUP='lobby \
    --name minecraft-lobby-1 itzg/minecraft-server

    The plugin:
    • automatically listens to docker events and add servers to BungeeCord as soon as a container starts.
    • is removing servers from BungeeCord as soon as the container gets stopped.
    • is able to listen on healthcheck actions like "health_status: healthy" or "health_status: unhealthy" to add and remove servers
    • inspects all running containers on start to add them initially

    Connection Balancing (Don't want to call it Load Balancing because in theory it isn't)

    Configure server groups:
    • Define default server groups (like lobbies) which players will get connected to
    • Define which server groups a player can directly reconnect to and which not.
    • Define force_hosts for server groups.
      (like eu-lobbies =, us-lobbies =
    • restrict access for server groups
    • Define group Traffic rules (balance, random or fill-up strategy)
    A server will get assigned to a group based on his environment variable (i.e SERVER_GROUP=lobby)

    Last but not least
    Plugin Messaging

    Using Bungeecords messaging system to notify Plugins with server data and server list.
    This would enable automated server selector menus which are always showing up available servers.

    Message listeners:
    Imaging spawning new Minecraft instances by clicking a button in minecraft which would cause docker to run a defined preset.

    Still in Development: Auto-Scaling

    Configure auto-scaling to automatically create new servers if certain condition is reached (like 80% players slots are taken)

    I am looking forward to get some Feedback and also ideas!
    Everything is highly configurable even the names of environment variables.
    If I get the feeling that I am not the only one who dockerized Minecraft I am happy to share and open source this plugin.
    • Like Like x 1
    • Winner Winner x 1
  2. I posted this in the wrong thread. I will reopen it in the Bungeecord development thread.

    New Post here

    As I do not have a clue how to close or delete it:
    It is closed!