From 2f243f97e41d6a7b84e8068e66c1ce27785e04f7 Mon Sep 17 00:00:00 2001 From: niten Date: Thu, 3 Aug 2023 12:53:26 -0700 Subject: [PATCH] Keep web alive to run db migrate --- mastodon-container.nix | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/mastodon-container.nix b/mastodon-container.nix index 346ccae..984ccb9 100644 --- a/mastodon-container.nix +++ b/mastodon-container.nix @@ -302,12 +302,14 @@ in { "${cfg.state-directory}/mastodon:/mastodon/public/system" "${cfg.state-directory}/mastodon-opt:/opt" ]; - command = '' - bash -c "rm -f /mastodon/tmp/pids/server.pid; bundle exec rails s -p 3000"''; - healthcheck.test = [ - "CMD-SHELL" - "wget -q --spider --proxy=off localhost:3000/health || exit 1" - ]; + # Keep the container running so we can pop in and migrate + command = ''bash -c "while :; do 'hit ctrl-c!'; sleep 1; done"''; + # command = '' + # bash -c "rm -f /mastodon/tmp/pids/server.pid; bundle exec rails s -p 3000"''; + # healthcheck.test = [ + # "CMD-SHELL" + # "wget -q --spider --proxy=off localhost:3000/health || exit 1" + # ]; depends_on = [ "postgres" "redis" ]; networks = [ "internal_network" ]; user = mkUserMap cfg.uids.mastodon;