0
  1. I Execute docker-compose up
  2. The Dash app seems to work fine (see the output)
  3. Dash app cannot be accessed through the local browser localhost:8050

Dash file:

app = dash.Dash(__name__)

//...

if __name__ == '__main__':
    app.run_server(debug=True, host='0.0.0.0', port=8050)

docker-compose file:

version: "3.7"
services:
  dashapp:
    image: my_dash_image
    container_name: my-dash
    ports:
      - 8050:8050
    volumes:
      - /tmp/files:/usr/src/app

Output execution:

my-dash | Hello!
my-dash | Running on http://127.0.0.1:8050/
my-dash | Debugger PIN: 576-910-730
my-dash |  * Serving Flask app "global_overview_indicators" (lazy loading)
my-dash |  * Environment: production
my-dash |    WARNING: This is a development server. Do not use it in a production deployment.
my-dash |    Use a production WSGI server instead.
my-dash |  * Debug mode: on
tremendows
  • 4,192
  • 3
  • 31
  • 50
  • can you check "telnet 127.0.0.1 8050" from both the container and your host machine? Is it getting connected? – Munish Feb 20 '20 at 18:48
  • also, is the browser you are using is also running on your Docker host machine? – Munish Feb 20 '20 at 18:50
  • can you try to change the last part of dash file to this: `if __name__ == "__main__": port = 8050 app.run(host="0.0.0.0", port=port, threaded=True) ` and remove port from yml file ? – Batchen Regev Feb 20 '20 at 22:46
  • @BatchenRegev Dash does not have the function run, it just have run_server(). I've already updated and tried, but it does not work. //app.run_server(debug=True, host='0.0.0.0', port=8050) . Why threaded? – tremendows Feb 21 '20 at 09:06
  • This is how my app works, did you try curl from the host the docker is on ? like `curl 127.0.0.1:8050` ? – Batchen Regev Feb 23 '20 at 17:09

0 Answers0