fix: Resolve port conflict causing Railway healthcheck failure
Flask API was using PORT env variable which Railway also assigns to the frontend static server. Both services were competing for the same port, causing the container to fail health checks. Changed Flask to use FLASK_PORT (default 5000) so it runs independently from the Railway-assigned PORT used by the serve command. https://claude.ai/code/session_01YEMFAbGgf8K7as4Uqgjv3R
This commit is contained in:
parent
dac7677fcf
commit
bf9b4cd3c4
2 changed files with 6 additions and 1 deletions
|
|
@ -332,6 +332,8 @@ def get_field_mapping(template_name):
|
|||
|
||||
|
||||
if __name__ == '__main__':
|
||||
port = int(os.environ.get('PORT', 5000))
|
||||
# Use FLASK_PORT to avoid conflict with Railway's PORT variable
|
||||
# which is used by the frontend static file server
|
||||
port = int(os.environ.get('FLASK_PORT', 5000))
|
||||
debug = os.environ.get('FLASK_DEBUG', 'false').lower() == 'true'
|
||||
app.run(host='0.0.0.0', port=port, debug=debug)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue