docker-wikindx/docker-entrypoint-wikindx

31 lines
958 B
Plaintext
Raw Normal View History

2021-01-16 20:44:14 +01:00
#!/bin/bash
/usr/bin/mysql_install_db -u mysql
/usr/bin/mysqld_safe --defaults-file=/etc/mysql/mariadb.cnf --basedir=/usr --socket=/var/run/mysqld/mysqld.sock --datadir='/var/lib/mysql' &
if [ ! -d /var/lib/mysql/wikindx6 ] ; then
sleep 1
mysql -u root < create.sql
fi
# for updating from old docker container
if [ -d /home/wikindx/core ]; then
mv /home/wikindx/config.php /tmp/
rm /home/wikindx/* -rf
mv /tmp/config.php /home/wikindx/config.php
chown -R www-data.www-data /home/wikindx
fi
# make sure a configuration file exists
if [ ! -e /home/wikindx/config.php ]; then
cp /var/www/html/config.php.dist /home/wikindx/config.php
chown -R www-data.www-data /home/wikindx
fi
# make sure configuration file is linked to application directory
if [ ! -e /var/www/html/config.php ]; then
ln -s /home/wikindx/config.php /var/www/html/config.php
2021-02-06 22:21:10 +01:00
chown -R www-data.www-data /var/www/html/wikindx
2021-02-06 22:00:39 +01:00
fi
2021-01-16 20:44:14 +01:00
docker-php-entrypoint apache2-foreground