From 0095d2a7926e12e2d88e66a143b1825ae1c1ef06 Mon Sep 17 00:00:00 2001 From: Cal Corum Date: Thu, 9 Apr 2026 08:41:47 -0500 Subject: [PATCH 1/2] fix: drop :latest tag from CI, make worker count configurable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove :latest Docker tag to match Paper Dynasty convention — only :version and :environment tags are pushed. Add WEB_WORKERS env var to Dockerfile (default 2) so prod can override via docker-compose. Co-Authored-By: Claude Opus 4.6 (1M context) --- .gitea/workflows/docker-build.yml | 2 -- Dockerfile | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/docker-build.yml b/.gitea/workflows/docker-build.yml index 8561567..4549ec6 100644 --- a/.gitea/workflows/docker-build.yml +++ b/.gitea/workflows/docker-build.yml @@ -58,7 +58,6 @@ jobs: tags: | manticorum67/major-domo-database:${{ steps.version.outputs.version }} manticorum67/major-domo-database:${{ steps.version.outputs.environment }} - manticorum67/major-domo-database:latest cache-from: type=registry,ref=manticorum67/major-domo-database:buildcache cache-to: type=registry,ref=manticorum67/major-domo-database:buildcache,mode=max @@ -71,7 +70,6 @@ jobs: echo "**Image Tags:**" >> $GITHUB_STEP_SUMMARY echo "- \`manticorum67/major-domo-database:${{ steps.version.outputs.version }}\`" >> $GITHUB_STEP_SUMMARY echo "- \`manticorum67/major-domo-database:${{ steps.version.outputs.environment }}\`" >> $GITHUB_STEP_SUMMARY - echo "- \`manticorum67/major-domo-database:latest\`" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY echo "**Build Details:**" >> $GITHUB_STEP_SUMMARY echo "- Commit: \`${{ steps.version.outputs.sha_short }}\`" >> $GITHUB_STEP_SUMMARY diff --git a/Dockerfile b/Dockerfile index e43e59a..600538d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,4 +30,5 @@ HEALTHCHECK --interval=30s --timeout=10s --start-period=10s --retries=3 \ CMD curl -f http://localhost:80/api/v3/current || exit 1 # Start uvicorn -CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "80", "--workers", "2"] \ No newline at end of file +ENV WEB_WORKERS=2 +CMD uvicorn app.main:app --host 0.0.0.0 --port 80 --workers $WEB_WORKERS \ No newline at end of file From 6efba473a00c90c2c47a9530b0791b68223b0de5 Mon Sep 17 00:00:00 2001 From: Cal Corum Date: Thu, 9 Apr 2026 09:01:18 -0500 Subject: [PATCH 2/2] fix: use exec form CMD so uvicorn receives SIGTERM as PID 1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Shell form CMD makes /bin/sh PID 1 — SIGTERM from docker stop goes to the shell, not uvicorn, causing SIGKILL after the stop timeout instead of graceful shutdown. Using CMD ["sh", "-c", "exec uvicorn ..."] lets the shell expand $WEB_WORKERS then exec-replaces itself with uvicorn, restoring correct signal delivery. Co-Authored-By: Claude Sonnet 4.6 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 600538d..1e0ccb5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -31,4 +31,4 @@ HEALTHCHECK --interval=30s --timeout=10s --start-period=10s --retries=3 \ # Start uvicorn ENV WEB_WORKERS=2 -CMD uvicorn app.main:app --host 0.0.0.0 --port 80 --workers $WEB_WORKERS \ No newline at end of file +CMD ["sh", "-c", "exec uvicorn app.main:app --host 0.0.0.0 --port 80 --workers $WEB_WORKERS"] \ No newline at end of file