I’ve got an issue concerning fly secrets and setting up a workflow with docker-compose
I’ve got my app suite set up in docker compose the way I expect it to work on fly.io.
However, I’ve my app is set up to consume a secret provided by fly in the $WHATEVER format. But it seems that docker compose ignores all ENV vars that begin with that character. I can’t seem to get docker compose to pass in my nice secure $DATABASE_URL. All other ENV vars work just as fine, as demonstrated below.
If I understand the question right, you have DATABASE_URL set as a system environment variable, and you want the Docker Compose service to use the system environment variable? If that’s what you’re after, try this:
Not quite. I want to replicate the behavior of my image as it would be in the fly environment, which has secret env vars, like $DATABASE_URL. I’d like to pass to docker $DATABASE_URL from docker-compose.yml
However, docker-compose is not able to pass env vars with such a initial character.
Is it possible to change the secret ENV in fly so that it doesn’t use such an initial character… something like SECRET_DATABASE_URL, perhaps?
Environment variables shouldn’t have $ prepended to them when declaring them, only when using them in bash or files that support environment variable interpolation.
AFAIK, fly doesn’t declare any environment variables anywhere that start with $, only locations where an environment is used does it have $.