Skip to content

[🐛 BUG] -H host flag does not properly bind to all interfaces #2712

@carlsonp

Description

@carlsonp

🔍 What went wrong?

We are trying to deploy a Taipy application through a Docker container. We have read the documentation on deploying through Docker. It seems like the -H host parameter when set to 0.0.0.0 is not properly binding to all interfaces. It is overriding this and only picking localhost.

This was also mentioned in issue: #533

When we try a plain Flask application, it binds to all interfaces and works properly. We need it to bind to all interfaces so localhost/127.0.0.1 AND the Docker network likely something like 172.X.X.X.

Without this fix, we are unable to deploy our Taipy app in production. Thank you.

✅ Expected Behavior

We expected the -H flag to bind to all interfaces including the virtual networking that Docker uses.

🔄 Steps to Reproduce

We have this in our Dockerfile:

CMD ["python", "main.py", "-P", "5000", "-H", "0.0.0.0", "--debug"]

The startup logs show:

INFO:Taipy:'allow_unsafe_werkzeug' has been set to True
INFO:Taipy:'async_mode' parameter has been overridden to 'threading'. Using Flask built-in development server with debug mode
[2025-08-27 14:38:50.010][Taipy][INFO] 'allow_unsafe_werkzeug' has been set to True
[2025-08-27 14:38:50.010][Taipy][INFO] 'async_mode' parameter has been overridden to 'threading'. Using Flask built-in development server with debug mode
[2025-08-27 14:38:50.055][Taipy][INFO]  * Server starting on http://localhost:5000
INFO:Taipy: * Server starting on http://localhost:5000
 * Serving Flask app 'Taipy'
 * Debug mode: on

Note the localhost in the logs. Every single setting and combination I've tried has not changed this. Taipy is picking up on the host parameter/flag though because if I put in an IP address there, it does try to bind to it. So it's not that it's being ignored, it just seems like Taipy is not properly binding in the 0.0.0.0 case.

If we try a plain Flask app:

CMD ["gunicorn", "flasktestapp:app", "--bind", "0.0.0.0:5000"]

We get the following in the logs:

[2025-08-27 14:35:38 +0000] [1] [INFO] Starting gunicorn 23.0.0
[2025-08-27 14:35:38 +0000] [1] [INFO] Listening at: http://0.0.0.0:5000 (1)
[2025-08-27 14:35:38 +0000] [1] [INFO] Using worker: sync
[2025-08-27 14:35:38 +0000] [7] [INFO] Booting worker with pid: 7

This is working properly and will deploy correctly.

💻 Runtime Environment

Docker version 28.3.2, build 578ccf6

🌐 Browser (if applicable)

Firefox

🖥️ Operating System

Linux

📦 Taipy Version

4.1.0

📋 Additional Context (Optional)

📜 Code of Conduct

  • I have checked the existing issues to avoid duplicates.
  • I am willing to work on this issue (optional)

✅ Acceptance Criteria

  • A reproducible unit test is added.
  • Code coverage is at least 90%.
  • The bug reporter validated the fix.
  • Relevant documentation updates or an issue created in

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions