Server problem
artwearshop
HOBBYOP

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:

  1. Procfile Configuration:
    I created a Procfile in the root directory of my project with the following content:

    less

    ZkopírovatUpravit

    web: waitress-serve --host=0.0.0.0 --port=$PORT app:app

    This should allow Waitress to serve the Flask application in production.

  2. requirements.txt:
    In requirements.txt, I ensured that waitress is listed as a dependency:

    ini

    ZkopírovatUpravit

    waitress==3.0.2

  3. App 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.

  4. Deployment Steps:

    • I pushed the changes to GitHub.

    • I deployed the project to Railway using git push origin main.

  5. Problem:
    After deployment, I still see the warning:

    pgsql

    Zkopí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!

Solved$10 Bounty

Pinned Solution

opqr
FREE

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

opqr
FREE

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.

artwearshop
HOBBYOP

9 months ago

Hi, thank you. It was part of the problem.


Status changed to Solved chandrika 10 months ago


Loading...