Docker - connect DB and create user credentials manually (not in vault) possible?

Don’t read if you are not familiar with vault and docker (rootless)! :wink:

Months have passed.
I need to know - because I don’t know if it’s possible or not - how to use Docker (rootless) with hasicorp vault and the command “docker run…” and/or with the command “docker compose”.

I found something like this:

My idea with docker (rootless):
I want to use 1 database (docker container) with multiple online stores (each store also has its own docker container).

OffTopic:
-It doesn’t matter if I run these onlineshops (docker container) with “docker run” or with “docker compose”, because each will have its own subfolder…
-Each store will have its own database and database user/password.
-There will be only 1 database container where to connect to

My question:
If I use Hashicorp Vault and do it like in the link - a few line above - then only Vault can create my database users - correct?
How can I make it so that I can manually create my database AND my user (using phpmyadmin for example) and vault only creates and uses my password for those users?

Next question:
What does the command for my persistent data (docker volumes) look like when I use “docker run” and what if I used a docker compose file?

Somehow I have to connect the vault container to the database.

Translated with DeepL Translate: The world's most accurate translator (free version)

Really? Nobody knows? :roll_eyes: