I'm experimenting with docker containers. More precise, I use docker-compose. I need to pass variables to my container and use an .env file for that. While that works, it makes my wonder how secure it is. I mean every script language has access to env and therefore any hack in the runnning application could expose sensitive data stored in env. I want to store data like db passwords.
Inspired by salt, I am looking for a way to safely pass my variables into my application template before building the container, instead of passing them into the env of the container. How could one achieve this?