dash应用程序在启动jupyter笔记本容器时拒绝连接

时间:2020-03-23 08:06:04

标签: python docker containers plotly-dash hyphen

尝试从jupyter笔记本容器中启动密探破折号时,其显示如下错误:

The site cant be reached ' 10.*.*.*.* refused to connect.ERR_CONNECTION_REFUSED.

我正在运行以下代码。

import dash
import dash_core_components as dcc
import dash_html_components as html

external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']

app = dash.Dash(__name__, external_stylesheets=external_stylesheets)

app.layout = html.Div(children=[
    html.H1(children='Hello Dash'),

    html.Div(children='''
        Dash: A web application framework for Python.
    '''),

    dcc.Graph(
        id='example-graph',
        figure={
            'data': [
                {'x': [1, 2, 3], 'y': [4, 1, 2], 'type': 'bar', 'name': 'SF'},
                {'x': [1, 2, 3], 'y': [2, 4, 5], 'type': 'bar', 'name': u'Montréal'},
            ],
            'layout': {
                'title': 'Dash Data Visualization'
            }
        }
    )
])

if __name__ == '__main__':
    app.run_server(debug=False)

它显示http://127.0.0.1:8050上的跑步。但不能在本地主机或10. 。*:8050上启动 我也EXPOSE PORT 8050在dockerfile中进行连接。

0 个答案:

没有答案