Thanks for your great work, especially for this article.
Although we have carefully crafted this example it may contain bugs, security issues or other problems that we were not aware of at the time.
Here is what we do:
Using the swarm mode of Docker, we create Docker Secrets.
Instead of
MYSQL_PASSWORD | MySQL password | secure
we're using:
MYSQL_PASSWORD | MySQL password | secure or /run/secrets/MYSQL_PASSWORD
The place, where we need it, we do something like:
$password = $is_dev ? $_ENV['MYSQL_PASSWORD'] : trim(file_get_contents($_ENV['MYSQL_PASSWORD'])),
So, if $is_dev, we can use it as plaintext, otherwise we get the output from our docker secret.
Thanks for your great work, especially for this article.
Here is what we do:
Using the swarm mode of Docker, we create Docker Secrets.
Instead of
MYSQL_PASSWORD | MySQL password | secure
we're using:
MYSQL_PASSWORD | MySQL password | secure or /run/secrets/MYSQL_PASSWORD
The place, where we need it, we do something like:
So, if
$is_dev, we can use it as plaintext, otherwise we get the output from our docker secret.