Docker access www folder

I need to render some images stored in the "www/" folder. Everything works smoothly on my local machine, but the images fail to display when running in Docker. Upon inspection, it seems that Docker isn't accessing the correct path, as the "www" folder is missing from the path. I temporarily fixed this by adding shiny::addResourcePath('www', '/home/shiny/www'), which works only in Docker. However, I'm looking for a permanent and decent solution that works both locally and in Docker. Thanks.

In my case, I have both the app.R file and the www folder inside a source folder located where the docker image is created.
Then adding a COPY source/ /srv/shiny-server command in the Dockerfile is enough to "install" my app on the shiny-server image.
I hope that helps.

1 Like