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 #!/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 if [ -n "$DATABASE_URL" ]
echo "Waiting on MySQL" then
while ! mysqladmin ping -h db --silent; do # https://stackoverflow.com/a/29793382
# Show some progress echo "Waiting on MySQL"
echo -n '.'; while ! mysqladmin ping -h db --silent; do
# Show some progress
echo -n '.';
sleep 1;
done
echo "Ready"
# Give it another second.
sleep 1; sleep 1;
done fi
echo "Ready"
# Give it another second.
sleep 1;
echo "Starting CTFd" 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' 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'