blue-nebula / base

Main repository of Blue Nebula, a fast-paced shooter with a unique parkour system. It is a fork of Red Eclipse and is free software.
https://blue-nebula.org
15 stars 6 forks source link

Build and publish Docker images #257

Open TheAssassin opened 1 year ago

TheAssassin commented 1 year ago

See https://github.com/TheAssassin/base/pkgs/container/bn-server for a demo. The images are fully working and optimized for size.

For now, we will only have a moving target tag called master (and possibly others for other branches) for public use. Once we create a tag, we'll have a similarly named tag pushed to the registry as well.

The Dockerfile and the docker-compose config were written from scratch. The remaining scripting comes from https://github.com/TheAssassin/redeclipse-docker/.

Note that we do not have any documentation on how to use these. We should document how you can dump the servinit.cfg template so as a user, you can see which variables are available.

Edit: to run the most basic server locally, use the following command:


> docker run --rm -it -p 28801:28801/udp -p 28802:28802/udp ghcr.io/theassassin/bn-server:master
TheAssassin commented 1 year ago

I managed to remove the patch by introducing a new server variable called serverpublicip, which allows a server to advertise itself to a masterserver properly if both are in the same subnet or on the same host. The masterserver already knows it should use the advertised one. As the master will ping the server anyway using either the advertised IP or the one found in the UDP packet, this should work just fine (just like it used to in the last years with the old workaround that abused serverip for the purpose).

TheAssassin commented 1 year ago

Tested this new variable in production now, works just the way it's meant to work.