Added overrider to use docker secrets for mariadb password
This commit is contained in:
@@ -25,6 +25,10 @@ Frappe framework release. You can find all releases [here](https://github.com/fr
|
||||
|
||||
Password for MariaDB (or Postgres) database.
|
||||
|
||||
### `DB_PASSWORD_SECRETS_FILE`
|
||||
|
||||
Path to the db_password.txt file. Set only if you use docker secrets for the database password (use `overrides/compose.mariadb-secrets.yaml`)
|
||||
|
||||
### `DB_HOST`
|
||||
|
||||
Hostname for MariaDB (or Postgres) database. Set only if external service for database is used or the container can not be reached by its service name (db) by other containers.
|
||||
|
||||
@@ -4,6 +4,9 @@ ERPNEXT_VERSION=v15.67.0
|
||||
|
||||
DB_PASSWORD=123
|
||||
|
||||
#Only if you use docker secrets for the db password
|
||||
DB_PASSWORD_SECRETS_FILE=
|
||||
|
||||
# Only if you use external database
|
||||
DB_HOST=
|
||||
DB_PORT=
|
||||
|
||||
12
overrides/compose.mariadb-secrets.yml
Normal file
12
overrides/compose.mariadb-secrets.yml
Normal file
@@ -0,0 +1,12 @@
|
||||
services:
|
||||
db:
|
||||
environment:
|
||||
- MYSQL_ROOT_PASSWORD: /run/secrets/db_password
|
||||
healthcheck:
|
||||
test: mysqladmin ping -h localhost --password="$(cat /run/secrets/db_password)"
|
||||
secrets:
|
||||
- db_password
|
||||
|
||||
secrets:
|
||||
db_password:
|
||||
file: ${DB_PASSWORD_SECRETS_FILE:?No db secret file set}
|
||||
@@ -10,7 +10,7 @@ services:
|
||||
db:
|
||||
image: mariadb:10.6
|
||||
healthcheck:
|
||||
test: mysqladmin ping -h localhost --password=${DB_PASSWORD}
|
||||
test: mysqladmin ping -h localhost --password=${DB_PASSWORD:-123}
|
||||
interval: 1s
|
||||
retries: 20
|
||||
restart: unless-stopped
|
||||
@@ -20,7 +20,7 @@ services:
|
||||
- --skip-character-set-client-handshake
|
||||
- --skip-innodb-read-only-compressed # Temporary fix for MariaDB 10.6
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: ${DB_PASSWORD:?No db password set}
|
||||
MYSQL_ROOT_PASSWORD: ${DB_PASSWORD:-123}
|
||||
volumes:
|
||||
- db-data:/var/lib/mysql
|
||||
|
||||
|
||||
Reference in New Issue
Block a user