From fc54cd76585d7184cf70431f69dade0c2f6d4cef Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Wed, 14 May 2025 12:33:07 -0400 Subject: [PATCH] Docker TTL (#750) ## Description: - Terminate docker containers in staging subdomains after 24 hours. - Reduce worker count to 2 for these deployments. ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced - [x] I understand that submitting code with bugs that could have been caught through manual testing blocks releases and new features for all contributors --------- Co-authored-by: Scott Anderson <662325+scottanderson@users.noreply.github.com> --- src/core/configuration/PreprodConfig.ts | 3 +++ startup.sh | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/core/configuration/PreprodConfig.ts b/src/core/configuration/PreprodConfig.ts index 3a842c88d..227cccf94 100644 --- a/src/core/configuration/PreprodConfig.ts +++ b/src/core/configuration/PreprodConfig.ts @@ -6,6 +6,9 @@ export const preprodConfig = new (class extends DefaultServerConfig { return GameEnv.Preprod; } numWorkers(): number { + if (process.env.SUBDOMAIN !== "main") { + return 2; + } return 3; } jwtAudience(): string { diff --git a/startup.sh b/startup.sh index 48595eee2..a7d7d76ff 100644 --- a/startup.sh +++ b/startup.sh @@ -104,4 +104,8 @@ else fi # Start supervisord -exec /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf \ No newline at end of file +if [ "$DOMAIN" = openfront.dev ] && [ "$SUBDOMAIN" != main ]; then + timeout 24h /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf +else + exec /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf +fi