nixos-configs/configurations/nos/modules/docker/resume/compose.nix

63 lines
1.3 KiB
Nix
Raw Normal View History

2024-07-24 15:49:31 -04:00
{
config,
pkgs,
...
}: let
2024-02-28 13:17:20 -05:00
inherit (config.sops) secrets;
2024-07-24 15:49:31 -04:00
inherit (config.khepri) rwDataDir;
2024-02-28 13:17:20 -05:00
rwPath = rwDataDir + "/resume";
in {
khepri.compositions."resume" = {
networks.proxy_net = {external = true;};
2024-02-28 13:17:20 -05:00
services = {
"postgres" = {
image = import ./images/postgres.nix pkgs;
restart = "always";
2024-02-28 13:17:20 -05:00
ports = ["5432:5432"];
2024-02-28 13:17:20 -05:00
volumes = [
"${rwPath}/db:/var/lib/postgresql/data"
];
environmentFiles = [secrets.resume.path];
networks = ["proxy_net"];
};
2024-02-28 13:17:20 -05:00
"server" = {
image = import ./images/resume-server.nix pkgs;
restart = "always";
2024-02-28 13:17:20 -05:00
ports = ["3100:3100"];
2024-02-28 13:17:20 -05:00
dependsOn = ["postgres"];
2024-02-28 13:17:20 -05:00
environmentFiles = [secrets.resume.path];
2024-02-28 13:17:20 -05:00
environment = {
PUBLIC_URL = "https://resume.nelim.org";
PUBLIC_SERVER_URL = "https://resauth.nelim.org";
};
networks = ["proxy_net"];
2024-02-28 13:17:20 -05:00
};
"client" = {
image = import ./images/resume-client.nix pkgs;
restart = "always";
2024-02-28 13:17:20 -05:00
ports = ["3060:3000"];
2024-02-28 13:17:20 -05:00
dependsOn = ["server"];
2024-02-28 13:17:20 -05:00
environment = {
PUBLIC_URL = "https://resume.nelim.org";
PUBLIC_SERVER_URL = "https://resauth.nelim.org";
};
networks = ["proxy_net"];
2024-02-28 13:17:20 -05:00
};
};
};
}