aurweb/docker/mariadb-init-entrypoint.sh
Kevin Morris dbeebd3b01
change(fastapi): setup live database in mariadb-init-entrypoint.sh
Centralize database setup there and remove all copying of
config.dev from the entrypoint scripts (the Dockerfile
now does it).

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-27 23:29:49 -08:00

17 lines
440 B
Bash
Executable file

#!/bin/bash
set -eou pipefail
# Setup a config for our mysql db.
aurweb-config set database name 'aurweb'
aurweb-config set database user 'aur'
aurweb-config set database password 'aur'
aurweb-config set database host 'localhost'
aurweb-config set database socket '/var/run/mysqld/mysqld.sock'
aurweb-config unset database port
if [ ! -z ${NO_INITDB+x} ]; then
exec "$@"
fi
python -m aurweb.initdb 2>/dev/null || /bin/true
exec "$@"