add mongodb to vps

This commit is contained in:
Yan Lin 2026-02-10 15:40:09 +01:00
parent 31de6897de
commit d2ab99fd7f
2 changed files with 11 additions and 1 deletions

View file

@ -22,5 +22,15 @@ in
autoStart = true;
};
mongodb = {
image = "docker.io/mongo:7";
volumes = [ "/var/lib/mongodb:/data/db" ];
environment = { TZ = systemTZ; };
environmentFiles = [ "/etc/mongodb-env" ];
ports = [ "27017:27017" ];
extraOptions = [ "--network=podman" ];
autoStart = true;
};
};
}

View file

@ -41,7 +41,7 @@
useDHCP = true; # VPS typically use DHCP
firewall = {
enable = true;
allowedTCPPorts = [ 22 80 443 ];
allowedTCPPorts = [ 22 80 443 27017 ];
trustedInterfaces = [ "tailscale0" ];
};
};