Container did not respond in time for my own app

Hi there,
I am new to ShinyProxy and have been trying to get my app to work, but I just keep getting the “Container did not respond in time” message. I built the docker image fine, and have referenced it in the application yaml. I have run my app using sudo docker run -p 3838:3838 wp/pupilinform2 and R does not throw up any error messages, but ends with ‘Listening on http://127.0.0.1:3927’. I have also increased the container-wait-time: 60000, but the container still does not respond. Does anyone know what else I can try?

Regards,
Will

Hi @WillP,

Can you try forcing your Shiny application to run on port 3838? See an example below. You expose the container’s 3838 port with -p 3838:3838, which means your app should also use that port. It seems to be set to 3927 in your example (or maybe a random port).

shiny::runApp(
  appDir = ".",
  host = '0.0.0.0',
  port = 3838
)  

Best regards,

Michael

1 Like

Hi Michael,
It does seem to use a random port. Where should I put that code? In the application.yml CMD line? (My docker image also has a CMD line).

Will

I’ve added the host and port to the Dockerfile CMD line and rebuilt the image. That has done the trick! Many thanks Michael!!! Very happy indeed :slight_smile:

Will

2 Likes

@WillP,

For the record, the example Dockerfile discussed in the Deploying Apps section of the ShinyProxy website includes the copying of an Rprofile.site file which will achieve the same thing (and does not require you to specify this for every individual app).

This is the relevant line.

Hope this helps!

Best,
Tobias

1 Like

Hi Tobias,
I did have an Rprofile.site file containing this:
local({ options(shiny.port = 3838, shiny.host = "0.0.0.0") })

But for some reason adding the CMD line made it work, where that didn’t. Any idea why?

I copied it in the dockerfile using:
COPY Rprofile.site /usr/lib/R/etc/

Will