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

56 lines
1.1 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 {
2024-07-24 15:49:31 -04:00
khepri.compositions."resume".services = {
2024-02-28 13:17:20 -05:00
"postgres" = {
2024-07-24 15:49:31 -04:00
image = import ./images/postgres.nix pkgs;
2024-02-28 13:17:20 -05:00
restart = "always";
ports = ["5432:5432"];
volumes = [
"${rwPath}/db:/var/lib/postgresql/data"
];
2024-07-24 15:49:31 -04:00
environmentFiles = [secrets.resume.path];
2024-02-28 13:17:20 -05:00
};
"server" = {
2024-07-24 15:49:31 -04:00
image = import ./images/resume-server.nix pkgs;
2024-02-28 13:17:20 -05:00
restart = "always";
ports = ["3100:3100"];
2024-07-24 15:49:31 -04:00
dependsOn = ["postgres"];
2024-02-28 13:17:20 -05:00
2024-07-24 15:49:31 -04: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";
};
};
"client" = {
2024-07-24 15:49:31 -04:00
image = import ./images/resume-client.nix pkgs;
2024-02-28 13:17:20 -05:00
restart = "always";
ports = ["3060:3000"];
2024-07-24 15:49:31 -04: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";
};
};
};
}