I am using docker-compose to create a rstudio service which will be integrated with other services such a db. I am trying to pass some environment variables from the docker-compose.yml file to rstudio. I need these variables in the docker-compose file as they will be changing for each customer. I cannot include them in the Dockerfile and also I cannot copy a .Rprofile file to the docker image.
version: '2.4'
services:
rstudio:
environment:
- USER=rstudio
- PASSWORD=qwerty
- MY_VAR=1
image: "rocker/verse:latest"
ports:
- 8787:8787
I want to access MY_VAR from the R environment using the rstudio user.