Last active
December 23, 2015 05:29
-
-
Save steeve/6587251 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ADD start.sh / | |
RUN chmod +x /start.sh | |
ENTRYPOINT ["/start.sh"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
USER=$1 | |
PASSWORD=$2 | |
ROOT_PASSWORD=$3 | |
# Make sure the DB exists | |
if [ ! "$(ls -A /var/lib/mysql)" ]; then | |
echo "Configuring database..." | |
mysql_install_db | |
mysqld_safe & | |
sleep 5 | |
mysql -uroot -e "CREATE DATABASE IF NOT EXISTS mydb;" | |
mysql -uroot -e "GRANT ALL PRIVILEGES ON vbulletin.* TO '$USER'@'localhost' IDENTIFIED BY '$PASSWORD';" | |
mysqladmin -u root password "$ROOT_PASSWORD" | |
kill `cat /var/run/mysqld/mysqld.pid` | |
fi | |
# Run all the daemons | |
supervisord -n -c /etc/supervisord.conf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment