Skip to content

fix: gunicorn start command for production server port#32

Merged
emidiovaleretto merged 1 commit into
mainfrom
fix/gunicorn-start-cmd
Jun 11, 2026
Merged

fix: gunicorn start command for production server port#32
emidiovaleretto merged 1 commit into
mainfrom
fix/gunicorn-start-cmd

Conversation

@emidiovaleretto

Copy link
Copy Markdown
Owner

What

Replaces the Dockerfile start command with gunicorn (shell form) and
removes the dev runserver command.

Why

The production deploy was returning 502. The deploy logs showed:
Error: '$PORT' is not a valid port number.

Two problems were behind it:

  1. The container was still starting with Django's runserver (dev server),
    not gunicorn.
  2. The gunicorn command was being passed in a way that left $PORT
    unexpanded — the literal string $PORT was reaching gunicorn instead
    of the port number Railway injects at runtime.

Using the shell form of CMD lets the shell expand $PORT to the real
port, so gunicorn binds correctly.

How to verify

  • Deploy logs no longer show the $PORT error and gunicorn starts
  • The app responds at the Railway URL (no more 502)
  • Migrations run via the release step in the Procfile

@emidiovaleretto emidiovaleretto merged commit 48d7588 into main Jun 11, 2026
2 checks passed
@emidiovaleretto emidiovaleretto deleted the fix/gunicorn-start-cmd branch June 11, 2026 11:22
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