I noticed that environment variables can be used inside the application.yml using sping’s SpEL.
However, this works on most parts, but not when setting the image of an application. See dummy application.yml
So I am trying to use environment variables to set the branch and other fields in the application.yml. All that I have testes so far work, except the image.
all these environment variables are passed in the docker compose
I made an open source solution for this, maybe it could help you? It does bash-interp on an application.yml.template file and actually creates a new applicaiton.yml on each container startup (using ENV vars):
You can pull the Dockerfile and start.sh, then make your own application.yml.template file… though make sure to escape bash-interpreted characters like quotes/parens/etc
You can indeed use expressions in the yaml, but there is an important distinction to make:
Property expressions (with the dollar notation) are parsed by Spring Boot’s externalized configuration system, when ShinyProxy starts up.
SpEl expressions (with the hash notation) are parsed by SpEL, when a proxy is launched. More info here.
That being said, I’m not sure why the expression would fail in the container-image setting. I just tested with an expression like this, and its value got inserted correctly:
Hi @fmichielssen,
I am trying to use environment variables to set up simple authentication. I am passing the username and pass to the shinyproxy container (swarm backend) and can check the values in it but the authentication fails when I try to log in. Is there any limit in using the environment variables for authentication?