4 DRUPAL_DB_PASSWORD
="${DRUPAL_DB_PASSWORD:-password}"
6 # install the mysql server
7 apt
install -y mariadb-server ||
:
8 # installation "fails" when working in a chroot
10 # should work on a regular system, but this part can't be tested in a chroot
12 # set up mysql with defaults
13 mysql_secure_installation
< /sqldefaults
16 mysql
-u root
-e "CREATE DATABASE $DRUPAL_DB_NAME CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;"
17 mysql
-u root
-e "GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES ON $DRUPAL_DB_NAME.* TO '$DRUPAL_DB_USER'@'localhost' IDENTIFIED BY '$DRUPAL_DB_PASSWORD';"
19 ## and have drupal do the site-install
21 #vendor/bin/drush site-install --db-url=mysql://drupaluser:$DRUPAL_DB_PASSWORD@localhost/drupal
23 # make sure perms are right
24 chown
-R www-data
:www-data
/var
/www
/html