9 months ago
I am trying to deploy a Flask application using Waitress on Railway. However, I am still seeing the warning message indicating that the app is running on the development server even though I have followed all necessary steps for deploying a production server. Here’s a summary of the steps I have taken:
Procfile Configuration:
I created a Procfile in the root directory of my project with the following content:lessZkopírovatUpravit
web: waitress-serve --host=0.0.0.0 --port=$PORT app:appThis should allow Waitress to serve the Flask application in production.
requirements.txt:
In requirements.txt, I ensured that waitress is listed as a dependency:iniZkopírovatUpravit
waitress==3.0.2App Configuration:
I updated my app.py to correctly initialize and configure the Flask app, making sure that the app is ready for deployment using a WSGI server.Deployment Steps:
I pushed the changes to GitHub.
I deployed the project to Railway using
git push origin main.
Problem:
After deployment, I still see the warning:pgsqlZkopírovatUpravit
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.Additionally, the application seems to be running on the Flask development server, not Waitress or any production server.
Next Steps:
I have verified that Waitress is included in requirements.txt and that Procfile is correctly set.
I’ve redeployed the app multiple times, but the issue persists.
Could you please assist in ensuring that Waitress is correctly used as the production WSGI server in my Railway deployment?
Thank you for your help!
Pinned Solution
9 months ago
Try setting the start command to waitress-serve --host=0.0.0.0 --port=$PORT app:app. You'll find it under your service-> settings -> deploy -> custom start command. Refer to the docs for more details.
2 Replies
9 months ago
Try setting the start command to waitress-serve --host=0.0.0.0 --port=$PORT app:app. You'll find it under your service-> settings -> deploy -> custom start command. Refer to the docs for more details.
opqr
Try setting the start command to waitress-serve --host=0.0.0.0 --port=$PORT app:app. You'll find it under your service-> settings -> deploy -> custom start command. Refer to the docs for more details.
9 months ago
Hi, thank you. It was part of the problem.
Status changed to Solved chandrika • 10 months ago