Split DATABASE_URL possible? #2332
budimanjojo
started this conversation in
Ideas
Replies: 2 comments 4 replies
-
You can also use that secret, if I'm correct that will be exposed to a file, which you can use directly using |
Beta Was this translation helpful? Give feedback.
4 replies
-
There is also a related Q&A here: #3991 Here is my Docker Compse file: version: "3"
volumes:
mariadb:
driver: local
services:
mariadb:
image: mariadb:11.1
restart: unless-stopped
volumes:
- mariadb:/var/lib/mysql
environment:
MARIADB_DATABASE: tresor
MARIADB_USER: tresor
MARIADB_PASSWORD_FILE: /run/secrets/db_password
MARIADB_ROOT_PASSWORD_FILE: /run/secrets/db_root_password
MARIADB_AUTO_UPGRADE: "1"
MARIADB_DISABLE_UPGRADE_BACKUP: "0"
MYSQL_RANDOM_ROOT_PASSWORD: "1"
labels:
- "com.centurylinklabs.watchtower.scope=tresor"
secrets:
- db_root_password
- db_password
tresor:
restart: unless-stopped
image: vaultwarden/server:latest
environment:
DATABASE_URL: "mysql://tresor:kr7SBHOhyDMw0hbT@mariadb/tresor"
INVITATIONS_ALLOWED: true
I_REALLY_WANT_VOLATILE_STORAGE: true
ports:
- "127.0.0.1:3700:80"
labels:
- "com.centurylinklabs.watchtower.scope=tresor"
secrets:
- db_password
watchtower:
image: containrrr/watchtower
volumes:
- /root/.docker/config.json:/config.json:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
# pruefe alle 12h = 43200 1200 Sec auf update
command: --interval 43200 --debug --scope=tresor
labels:
- "com.centurylinklabs.watchtower.scope=tresor"
secrets:
db_password:
file: db_password.txt
db_root_password:
file: db_root_password.txt It would be good if this could look like this: version: "3"
volumes:
mariadb:
driver: local
services:
mariadb:
image: mariadb:11.1
restart: unless-stopped
volumes:
- mariadb:/var/lib/mysql
environment:
MARIADB_DATABASE: tresor
MARIADB_USER: tresor
MARIADB_PASSWORD_FILE: /run/secrets/db_password
MARIADB_ROOT_PASSWORD_FILE: /run/secrets/db_root_password
MARIADB_AUTO_UPGRADE: "1"
MARIADB_DISABLE_UPGRADE_BACKUP: "0"
MYSQL_RANDOM_ROOT_PASSWORD: "1"
labels:
- "com.centurylinklabs.watchtower.scope=tresor"
secrets:
- db_root_password
- db_password
tresor:
restart: unless-stopped
image: vaultwarden/server:latest
environment:
DATABASE_TYPE: "mysql"
DATABASE_USER: "tresor"
DATABASE_PASSWORD_FILE: /run/secrets/db_password
DATABASE_DB: "tresor"
DATABASE_HOST: "mariadb"
INVITATIONS_ALLOWED: true
I_REALLY_WANT_VOLATILE_STORAGE: true
ports:
- "127.0.0.1:3700:80"
labels:
- "com.centurylinklabs.watchtower.scope=tresor"
secrets:
- db_password
watchtower:
image: containrrr/watchtower
volumes:
- /root/.docker/config.json:/config.json:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
# pruefe alle 12h = 43200 1200 Sec auf update
command: --interval 43200 --debug --scope=tresor
labels:
- "com.centurylinklabs.watchtower.scope=tresor"
secrets:
db_password:
file: db_password.txt
db_root_password:
file: db_root_password.txt |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, I have been a happy vaultwarden user since it was still bitwarden_rs.
Currently I'm running vaultwarden using kubernetes and I'm planning to manage my databases using an operator (https://github.com/zalando/postgres-operator/).
This postgres operator will create a random password for the database users and store the password in a Kubernetes
Secret
. Is it possible to split DATABASE_URL to multiple environment variables?My current idea is:
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions