From d0b155d786501fad6d3fcb93db60057568f25d9b Mon Sep 17 00:00:00 2001 From: Jack O'Sullivan Date: Wed, 20 Dec 2023 18:38:22 +0000 Subject: [PATCH] nixos/middleman: Wait for psql before starting nginx --- .../boxes/colony/vms/shill/containers/middleman/default.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/nixos/boxes/colony/vms/shill/containers/middleman/default.nix b/nixos/boxes/colony/vms/shill/containers/middleman/default.nix index 08c6701..1b5d183 100644 --- a/nixos/boxes/colony/vms/shill/containers/middleman/default.nix +++ b/nixos/boxes/colony/vms/shill/containers/middleman/default.nix @@ -132,6 +132,10 @@ in systemd = { network.networks."80-container-host0" = networkdAssignment "host0" assignments.internal; + services = { + # HACK: nginx seems to get stuck not being able to DNS early... + nginx = lib.my.systemdAwaitPostgres pkgs.postgresql "colony-psql"; + }; }; security = { @@ -234,6 +238,8 @@ in appendHttpConfig = '' ${baseHttpConfig} + resolver_timeout 5s; + # caching proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=CACHE:10m inactive=7d max_size=4g;