Skip to content

Fix Dockerfile startup command for FastAPI app - #1

Open
railway-app[bot] wants to merge 1 commit into
mainfrom
railway/code-change-TzNSfU
Open

Fix Dockerfile startup command for FastAPI app#1
railway-app[bot] wants to merge 1 commit into
mainfrom
railway/code-change-TzNSfU

Conversation

@railway-app

@railway-app railway-app Bot commented May 5, 2026

Copy link
Copy Markdown

Problem

The Dockerfile was using a convoluted sh -c wrapper with python -c to import app.main_debug and call uvicorn.run() inline. This approach is fragile — any import error or typo in the shell-escaped string silently prevents the server from binding, causing the app to fail to respond to HTTP requests on Railway.

Solution

Replaced the CMD with a clean exec-form ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"] that targets the correct production module app.main. This removes the shell indirection, eliminates the debug module dependency, and follows standard FastAPI/uvicorn deployment practice.

Changes

  • Modified backend/Dockerfile

Generated by Railway

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