Passing environment variables to ShinyProxy containers with the Docker operator

Hi,

I’m using the ShinyProxy Operator 2.3.1 with the pure Docker setup (no Kubernetes) and it works great.

I have secrets (OpenID client secret, API keys, DB passwords) that I’d like to reference in my ShinyProxy YAML config using ${VAR_NAME} syntax rather than hardcoding them. For example:

proxy:
  openid:
    client-secret: ${MY_CLIENT_SECRET}
  specs:
    - id: my_app
      container-image: my-registry/my-app
      container-env:
        DB_PASSWORD: ${MY_DB_PASSWORD}
        API_KEY: ${MY_API_KEY}

With the actual values defined in a .env file or similar mechanism.

The challenge is that the operator creates a separate container for each ShinyProxy instance, and that container doesn’t seem to inherit environment variables from the operator container. So even if I load a .env file via env_file: in docker-compose.yml, the variables are only available inside the operator container, not in the ShinyProxy containers it spawns.

Hardcoding the values directly in the YAML works fine as a workaround, but ideally I’d like to keep secrets separate from the configuration structure.

Is there a way to pass custom environment variables to the ShinyProxy containers created by the Docker operator? Or is this something that might be supported in the future?

Thanks!

1 Like