I’ve created a small dash app and trying to run on docker container.I get the following message
Dash is running on http://127.0.0.1:8050/
But when I try opening the link it shows trouble connecting to the page.
I tried the solution on Docker image not running on host 8050 but it doesn’t work as well.
My dockerfile:
FROM python:3.9
ADD main.py .
RUN pip install dash
RUN pip install plotly
RUN pip install pandas
RUN pip install flask
EXPOSE 8080/tcp
CMD [ "python3" ,"./main.py" ]
2
Answers
As others said, you need to change the port you’re exposing to 8050
to run using docker run
you should then be able to access it at http://127.0.0.1:8050/
Dockerfile like this
and build it
docker build -t YOURAPP:latest .
and run it
docker run -p 8050:8050 YOURAPP:latest