mirror of https://github.com/JohnHammond/CTFd.git
Adding .dockerignore and making docker-entrypoint consider DATABASE_URL (#312)
parent
92f130d5de
commit
2e5c8a1adb
|
@ -0,0 +1,7 @@
|
||||||
|
CTFd/logs/*.log
|
||||||
|
CTFd/static/uploads
|
||||||
|
CTFd/uploads
|
||||||
|
CTFd/*.db
|
||||||
|
CTFd/uploads/**/*
|
||||||
|
.ctfd_secret_key
|
||||||
|
.data
|
|
@ -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'
|
||||||
|
|
Loading…
Reference in New Issue