diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..63b706a --- /dev/null +++ b/.dockerignore @@ -0,0 +1,7 @@ +CTFd/logs/*.log +CTFd/static/uploads +CTFd/uploads +CTFd/*.db +CTFd/uploads/**/* +.ctfd_secret_key +.data diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index e0d82e1..d282b04 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -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 - # Show some progress - echo -n '.'; +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'