Use vault for save secret ,wordpress,nginx,mongodb,mysql docker-compose

I search around and I can not find best way to use vault for save and use secret and username used by application like mysql , wordpress, mariadb.
we run some website by docker-compose and wordpress use mysql as database,
How I can configure docker-compose use Vault for username and password mysql and wordpress?

If you find a solution please give feedback to me - thanks!

But i think we will not get any help for this because of two reasons:
-None of the community have/knows a solution for a specific question.
-The people of the hashicorp company who knows it (they are the “pros”) will not help because we are not enterprise customers.

I don’t want to use a software where to buy support because the community can’t help!

Can you be more specific ?
You can pass secrets at the deployement time in a file and use it in your compose. Ex:
"WORDPRESS_DB_PASSWORD_FILE: “/run/secrets/app_db_password”

Or you can modify your container’s entrypoint/startup script to pull secrets from vault

Or perhaps you can use envconsul

If you really interested in helping us it would be nice if you could make a tutorial step by step (Wordpress, Mysql as “docker compose” with Hashicorp Vault secrets(kv?)).
So we can understand how to use Hashicorp Vault for “docker compose”.


You’ve been given several suggestions on approaches to investigate. There are loads of guides, documentation and blog articles that can give you more details.

If you are wanting someone to show you exactly what to do & write the code for you I’m sure there are many highly experienced paid consultants who would be happy to help. A community volunteer is happy to guide you in the right direction, but generally wouldn’t have the time or desire to act as an unpaid staff member.

1 Like

That’s exactly what i’m talking in my first posting above!
No free help.

I’ve seen dozens of tutorials and videos, none have been able to help me.

To understand how it works a step by step tutorial would be helpful!
But ok, if you don’t help you don’t need! I’m fine with that.

You have already been given free help, with suggestions of approaches to try. It sounds like you’ve also found lots of other free tutorials and videos. What you are less likely to find for free are custom step by step tutorials for your exact need - you might find something very similar if someone else had the same problem and chose to document their work.

What you need to do is apply the different tutorials, documentation and blog articles to your problem. If you get stuck please come back and ask specific questions, ideally showing the details you’ve tried and the errors you are seeing. For example show the Docker Compose file you are using, the output from starting things and what doesn’t happen as expected, or how you’ve adjusted your Docker image startup script/entrypoint to pull secrets and what is/isn’t happening.

1 Like

I can not find good solution for this this problem,

What solutions have you looked at that didn’t work?

Have you tried the above suggestions around using a file in your Docker Compose, using envconsul or updating your entrypoint script?

1 Like

I can not find good guide about this problem