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>
This commit is contained in:
Kevin Morris 2021-11-27 23:15:19 -08:00
parent 343a306bb8
commit dbeebd3b01
No known key found for this signature in database
GPG key ID: F7E46DED420788F3
6 changed files with 34 additions and 40 deletions

View file

@ -2,12 +2,16 @@
set -eou pipefail
# Setup a config for our mysql db.
cp -vf conf/config.dev conf/config
sed -i "s;YOUR_AUR_ROOT;$(pwd);g" conf/config
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 "$@"