Docker Compose files and adjustments

This commit is contained in:
Mark Ignacio
2016-01-08 19:42:23 -05:00
parent b8746e22bf
commit 1f1fbbf585
3 changed files with 47 additions and 1 deletions

15
docker-compose-run.sh Executable file
View File

@@ -0,0 +1,15 @@
#!/bin/sh
sed "s;sqlite:///ctfd.db;mysql+pymysql://${MYSQL_USER}:${MYSQL_PASSWORD}@db/ctfd;g" CTFd/config.py -i
# wait for mysql to start
while ! nc db 3306 >/dev/null 2>&1 < /dev/null; do
if [ $i -ge 50 ]; then
echo "$(date) - db:3306 still not reachable, giving up"
exit 1
fi
echo "$(date) - waiting for db:3306..."
sleep 1
done
gunicorn --bind 0.0.0.0:8000 -w 4 "CTFd:create_app()"