games: split it up into 3 different services for easier management
This commit is contained in:
parent
733b867f47
commit
3eac87bbd8
1 changed files with 31 additions and 7 deletions
|
@ -9,17 +9,24 @@
|
|||
];
|
||||
};
|
||||
|
||||
networking.firewall.allowedTCPPorts = [ 25565 ];
|
||||
networking.firewall.allowedTCPPorts = [
|
||||
# for the proxy
|
||||
25565
|
||||
|
||||
# the servers
|
||||
20000
|
||||
|
||||
20001
|
||||
];
|
||||
|
||||
# arion is one way to use docker on nixos
|
||||
# see https://gitlab.com/c2842/computer_society/nixos/-/blob/733b867f4782afa795848135a83e97a5cafaf16a/applications/games/minecraft.nix
|
||||
# for an example of a single compose file with multiple services
|
||||
virtualisation.arion = {
|
||||
backend = "docker";
|
||||
projects = {
|
||||
|
||||
# this is basically one single docker-compose file
|
||||
minecraft.settings = {
|
||||
docker-compose.raw.networks.default.name = "minecraft";
|
||||
|
||||
minecraft_proxy.settings = {
|
||||
services = {
|
||||
mc_proxy = {
|
||||
service = {
|
||||
|
@ -38,8 +45,12 @@
|
|||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
mc_compsoc = {
|
||||
minecraft_compsoc_classic.settings = {
|
||||
services = {
|
||||
compsoc_classic = {
|
||||
service = {
|
||||
image = "nimmis/spigot:latest";
|
||||
# setting these here as they arent special
|
||||
|
@ -51,10 +62,19 @@
|
|||
|
||||
# where the config files are stored
|
||||
volumes = [ "/etc/games/minecraft/compsoc/test/config:/minecraft" ];
|
||||
|
||||
ports = [
|
||||
"20000:25565/tcp"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
mc_compsoc2 = {
|
||||
};
|
||||
};
|
||||
|
||||
minecraft_compsoc_test.settings = {
|
||||
services = {
|
||||
compsoc_test = {
|
||||
service = {
|
||||
image = "nimmis/spigot:latest";
|
||||
environment = {
|
||||
|
@ -65,6 +85,10 @@
|
|||
|
||||
# where the config files are stored
|
||||
volumes = [ "/etc/games/minecraft/compsoc/test2/config:/minecraft" ];
|
||||
|
||||
ports = [
|
||||
"20001:25565/tcp"
|
||||
];
|
||||
};
|
||||
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue