Container-env-file not working


I can run the application outside of ShinyProxy just fine and load the env-file like so:

docker run --expose=3838 --name shiny-planting-schedule --rm -i -t --env-file C:\Users\user\Documents\.Renviron -p 3838:3838 shiny-planting-schedule

But adding the container-env-file parameter does not work inside the application.yml:

container-env-file: C:\Users\user\Documents\.Renviron

Moreover, I can use the container-env parameter inside the application.yml file and remove the container-env-file parameter, and then the application runs fine.

Am I incorrectly specifying the path to the env-file? Does the env-file need to be formatted differently than it would be if passed to docker run --env-file?


I assume you have a directory with an application.yml, Dockerfile and .Renviron file. In that case it might be a path issue, when building the image with ShinyProxy from within that directory, you can simply set the following container-env-file: .Renviron.

Besides that, I am not sure if the file extension matters, perhaps try storing the environment variables in an .env file? Given that you can run it fine with the --env-file input it should not matter though.


Yes, sorry, I should have mentioned that I have an application.yml, Dockerfile, and .Renviron file. Originally, the .Renviron file was in my Documents folder and I was happy leaving it there so I didn’t accidentally commit it to git. I tried moving it to the same directory as the Dockerfile and application.yml with no success. I also tried renaming the .Renviron file to env with no success. Not sure what I’m doing wrong at this point since the application works just fine if I run outside of ShinyProxy and load the .Renviron file with the --env-file option.


Can you confirm that you have a recent version of shinyproxy? There was an issue with container-env-file earlier ('container-env-file' not working) that was fixed.
Another idea to try maybe - specify the file path as described in Shinyproxy in container - mounting volumes on windows?


I think the issue is because I’m running ShinyProxy inside a docker container so the container-env-file parameter needs to reference a path to a an environmental variable list file inside the container instead of on the host machine. I’m guessing if I was running ShinyProxy standalone, the reference to a file on the host computer would work just fine. Thanks for your help!