Deploying a minimal flask app in docker - server connection issues

后端 未结 6 1288
清酒与你
清酒与你 2020-11-22 00:51

I have an app who\'s only dependency is flask, which runs fine outside docker and binds to the default port 5000. Here is the full source:

from          


        
6条回答
  •  渐次进展
    2020-11-22 01:17

    When using the flask command instead of app.run, you can pass the --host option to change the host. The line in Docker would be:

    CMD ["flask", "run", "--host", "0.0.0.0"]
    

    or

    CMD flask run --host 0.0.0.0
    

提交回复
热议问题