Adding .dockerignore and making docker-entrypoint consider DATABASE_URL (#312)

selenium-screenshot-testing
Kevin Chung 2017-07-13 02:43:17 -04:00 committed by GitHub
parent 92f130d5de
commit 2e5c8a1adb
2 changed files with 19 additions and 9 deletions

7
.dockerignore Normal file
View File

@ -0,0 +1,7 @@
CTFd/logs/*.log
CTFd/static/uploads
CTFd/uploads
CTFd/*.db
CTFd/uploads/**/*
.ctfd_secret_key
.data

View File

@ -1,15 +1,18 @@
#!/bin/sh
# http://stackoverflow.com/questions/25503412/how-do-i-know-when-my-docker-mysql-container-is-up-and-mysql-is-ready-for-taking#29793382
echo "Waiting on MySQL"
while ! mysqladmin ping -h db --silent; do
if [ -n "$DATABASE_URL" ]
then
# https://stackoverflow.com/a/29793382
echo "Waiting on MySQL"
while ! mysqladmin ping -h db --silent; do
# Show some progress
echo -n '.';
sleep 1;
done
echo "Ready"
# Give it another second.
sleep 1;
done
echo "Ready"
# Give it another second.
sleep 1;
fi
echo "Starting CTFd"
gunicorn --bind 0.0.0.0:8000 -w 1 'CTFd:create_app()' --access-logfile '/opt/CTFd/CTFd/logs/access.log' --error-logfile '/opt/CTFd/CTFd/logs/error.log'