'Running docker shiny app on my own domain

I have a VPS Linux (Ubuntu) server with specific IP and I would like to run my shiny app on my own domain http://my_domain.com. Therefore, I have built a docker container and I have run my app on the Ubuntu terminal:

sudo docker run -rm -p 4096:4096 my_app

It works well on the localhost. Then, I have modified the following lines in my Dockerfile:

EXPOSE 80
CMD ["R", "-e", "shiny::runApp('/srv/shiny-server/my_app/app',  host = 'server_ip', port = 80)"]

I have built and run my docker container again and I have got the following error:

sudo docker run --rm -p 80:80 my_app

Listening on http://server_ip:80
createTcpServer: address not available
Error in initialize(...) : Failed to create server

Maybe I need to configure nginx. I would be grateful if someone could tell me what would be the best solution to run my app on my own domain and how to do it.



Solution 1:[1]

Docker container does not have access to server_ip, try this :

EXPOSE 80
CMD ["R", "-e", "shiny::runApp('/srv/shiny-server/my_app/app', host = '0.0.0.0', port = 80)"]

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Philippe