Skip to content

fix(compose): keep gunicorn flags intact in web command#231

Open
uma-ipf wants to merge 1 commit into
masterfrom
fix/compose-gunicorn-command-flags
Open

fix(compose): keep gunicorn flags intact in web command#231
uma-ipf wants to merge 1 commit into
masterfrom
fix/compose-gunicorn-command-flags

Conversation

@uma-ipf

@uma-ipf uma-ipf commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

The web service used a YAML folded block scalar (command: >) for the sh -c script. Folded scalars collapse newlines to spaces, but the multi-line gunicorn invocation was being parsed such that the flags (--bind 0.0.0.0:8000, --workers, etc.) were dropped. gunicorn then fell back to its defaults: a single worker bound to 127.0.0.1:8000.

Because the process bound to container-loopback rather than 0.0.0.0, Docker's published port (127.0.0.1:8000:8000) could not reach it, so the reverse proxy returned 502.

Rewrite command as an explicit argv list with the full gunicorn invocation on a single physical line so every flag is preserved and the process binds to 0.0.0.0:8000 with the intended worker count.


Open in Stage

Summary by CodeRabbit

  • Bug Fixes
    • Improved web service startup command handling without changing the startup sequence or runtime behavior.
    • Database migrations and static asset collection continue to run automatically before the application starts.

The web service used a YAML folded block scalar (command: >) for the
sh -c script. Folded scalars collapse newlines to spaces, but the
multi-line gunicorn invocation was being parsed such that the flags
(--bind 0.0.0.0:8000, --workers, etc.) were dropped. gunicorn then
fell back to its defaults: a single worker bound to 127.0.0.1:8000.

Because the process bound to container-loopback rather than 0.0.0.0,
Docker's published port (127.0.0.1:8000:8000) could not reach it, so
the reverse proxy returned 502.

Rewrite command as an explicit argv list with the full gunicorn
invocation on a single physical line so every flag is preserved and
the process binds to 0.0.0.0:8000 with the intended worker count.
@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 96a60e3a-e1d8-4502-b480-a9ebe38df9b2

📥 Commits

Reviewing files that changed from the base of the PR and between 08f5806 and 1ef4252.

📒 Files selected for processing (1)
  • docker-compose.yml

Walkthrough

The web service startup command in docker-compose.yml now uses an explicit sh -c argument list while preserving the migration, static collection, and Gunicorn execution sequence and settings.

Changes

Web startup

Layer / File(s) Summary
Explicit web startup command
docker-compose.yml
The command changes to a YAML list containing sh, -c, and the folded startup script; migration, static collection, and Gunicorn arguments remain unchanged.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the Compose web command change and the goal of preserving Gunicorn flags.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/compose-gunicorn-command-flags

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@stage-review

stage-review Bot commented Jul 10, 2026

Copy link
Copy Markdown

Ready to review this PR? Stage has broken it down into 1 individual chapter for you:

Title
1 Fix gunicorn flag parsing in docker-compose
Open in Stage

Chapters generated by Stage for commit 1ef4252 on Jul 10, 2026 9:32am UTC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant