I have a problem seen the results of a Dash dashboard running on a container.
First my situation:
I have a Dockerfile like this
FROM ros:noetic
EXPOSE 8050
I run this container like this
docker build -t ros-noe-test .
xhost +local:root
docker run --rm -it \
--name noe-test \
-v "${MYPATH}/.ros/:/root/.ros/" \
-v "${MYPATH}/${MYDIR}/:/root/${MYDIR}/" \
--volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \
-p 8050:8050 \
--env="QT_X11_NO_MITSHM=1" \
--env="DISPLAY" \
-w "/root/${MYDIR}/" \
ros-noe-test \
/bin/bash
Notice that I have exposed the port 8050 and that I run the docker image with -p 8050:8050
Then inside the container I installed all necessary libraries (pandas, plotly, dash, etc) and I run the following simple example
import plotly.graph_objects as go
fig=go.Figure(data=go.Bar(y=[2,3,1,5]))
#fig.show()
import dash
import dash_core_components as dcc
import dash_html_components as html
app=dash.Dash()
app.layout= html.Div([
dcc.Graph(figure=fig)
])
app.run_server(debug=True, use_reloader=False)
and I get
Dash is running on http://127.0.0.1:8050/
Warning: This is a development server. Do not use app.run_server in production
use a production WSGI server like gunicorn instead
However when I go to http://127.0.0.1:8050/
in my browser I see that "The connection to the server was reset while the page was loading"
I run out of ideas of what to do.
Edit
Just for more info: after running the container if I do docker ps
I get
IMAGE: ros-nore-test
COMMAND: /ros_entrypoint.sh
STATUS: Up 5 minutes
PORTS: 0.0.0.0:8050->8050/tcp
NAMES: noe-test