mirror of
https://github.com/sameersbn/docker-gitlab.git
synced 2026-01-18 13:58:25 +00:00
start mysqld using supervisord
This commit is contained in:
parent
1ba0f1f8a2
commit
deec44fe44
@ -20,12 +20,23 @@ DB_INIT=${DB_INIT:-}
|
||||
|
||||
# start mysql server if ${DB_HOST} is localhost
|
||||
if [ "${DB_HOST}" == "localhost" ]; then
|
||||
DB_INIT="yes"
|
||||
mysql_install_db --user=mysql
|
||||
/usr/bin/mysqld_safe &
|
||||
sleep 3
|
||||
echo 'CREATE DATABASE IF NOT EXISTS `gitlabhq_production` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`;' | mysql -uroot
|
||||
echo 'GRANT SELECT, LOCK TABLES, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON `gitlabhq_production`.* TO 'root'@'localhost';' | mysql -uroot
|
||||
DB_INIT="yes"
|
||||
mysql_install_db --user=mysql
|
||||
cat > /etc/supervisor/conf.d/mysqld.conf <<EOF
|
||||
[program:mysqld]
|
||||
priority=20
|
||||
directory=/tmp
|
||||
command=/usr/bin/mysqld_safe
|
||||
user=root
|
||||
autostart=true
|
||||
autorestart=true
|
||||
stdout_logfile=/var/log/supervisor/%(program_name)s.log
|
||||
stderr_logfile=/var/log/supervisor/%(program_name)s.log
|
||||
EOF
|
||||
supervisorctl update
|
||||
sleep 3
|
||||
echo 'CREATE DATABASE IF NOT EXISTS `gitlabhq_production` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`;' | mysql -uroot
|
||||
echo 'GRANT SELECT, LOCK TABLES, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON `gitlabhq_production`.* TO 'root'@'localhost';' | mysql -uroot
|
||||
fi
|
||||
|
||||
if [ "${REDIS_HOST}" == "localhost" ]; then
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user