Wait for healthy

This commit is contained in:
2023-10-12 13:34:46 -07:00
parent 095ee19297
commit 875b5ffafe
+8 -2
View File
@@ -38,8 +38,10 @@ let
hostname = "lemmy"; hostname = "lemmy";
env_file = [ lemmyCfg.envFile ]; env_file = [ lemmyCfg.envFile ];
volumes = [ "${lemmyCfg.configFile}:/config/config.hjson:ro,Z" ]; volumes = [ "${lemmyCfg.configFile}:/config/config.hjson:ro,Z" ];
depends_on = depends_on = {
[ { "postgres".condition = "service_healthy"; } "pictrs" ]; postgres = "healthy";
pictrs = "healthy";
};
restart = "always"; restart = "always";
}; };
}; };
@@ -62,6 +64,10 @@ let
user = "${toString pictrsCfg.uid}:${toString pictrsCfg.uid}"; user = "${toString pictrsCfg.uid}:${toString pictrsCfg.uid}";
env_file = [ pictrsCfg.envFile ]; env_file = [ pictrsCfg.envFile ];
restart = "always"; restart = "always";
healthcheck.test = [
"CMD-SHELL"
"wget -q --spider --proxy=off localhost:/healthz || exit 1"
];
}; };
}; };
postgres = { postgres = {