Skip to content

Railway Deployment #ceafe4 fix: shell-expand $PORT in startCommand - #1

Open
railway-app[bot] wants to merge 1 commit into
mainfrom
railway/fix-deploy-ceafe4
Open

railway-app[bot] wants to merge 1 commit into
mainfrom
railway/fix-deploy-ceafe4

Conversation

@railway-app

@railway-app railway-app Bot commented Jun 25, 2026

Copy link
Copy Markdown

Problem

The container crashes immediately on startup with Error: Invalid value for '--port': '$PORT' is not a valid integer. For Dockerfile-based deployments, Railway executes the startCommand in exec form, which does not perform shell variable expansion — so $PORT is passed as the literal string to uvicorn instead of the actual port number.

Solution

Wrapped the startCommand in /bin/sh -c "..." so the shell expands $PORT to the actual port value before passing it to uvicorn. This matches the pattern required for Dockerfile-based services on Railway and aligns with the existing Dockerfile CMD which already uses sh -c for the same reason.

Changes

  • Modified railway.json

Context

  • Deployment: #ceafe4
  • Failed commit: 55ebba7

Generated by Railway

This branch has not been deployed

No deployments
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.

0 participants