9 months ago
Dear Railway Support,
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!
Best regards,
George
2 Replies
9 months ago
This thread has been marked as public for community involvement, as it does not contain any sensitive or personal information. Any further activity in this thread will be visible to everyone.
Status changed to Open chandrika • 10 months ago
9 months ago
Could you verify to me if your app.py file has this at the bottom:
if __name__ == '__main__':
app.run(debug=True) # This starts Flask's dev serverIf yes, remove or comment out any app.run() calls in your code. Your app.py should end with just the Flask app definition, not any calls to run it.
If not, verify your Railway deployment logs show "Starting process with command waitress-serve --host=0.0.0.0 --port=$PORT app:app", and if not, there might be a Procfile issue. (The file must be named exactly "Procfile" and placed on the Project's root)
9 months ago
Status changed to Closed chandrika • 10 months ago
