Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 772
Citizen Avatar asked May 31 '26 07:05

Citizen


1 Answers

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)"]
like image 199
Philippe Avatar answered Jun 01 '26 22:06

Philippe