mirror of
https://github.com/aljazceru/CTFd.git
synced 2025-12-17 14:04:20 +01:00
Adding .dockerignore and making docker-entrypoint consider DATABASE_URL (#312)
This commit is contained in:
7
.dockerignore
Normal file
7
.dockerignore
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
CTFd/logs/*.log
|
||||||
|
CTFd/static/uploads
|
||||||
|
CTFd/uploads
|
||||||
|
CTFd/*.db
|
||||||
|
CTFd/uploads/**/*
|
||||||
|
.ctfd_secret_key
|
||||||
|
.data
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
#!/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" ]
|
||||||
|
then
|
||||||
|
# https://stackoverflow.com/a/29793382
|
||||||
echo "Waiting on MySQL"
|
echo "Waiting on MySQL"
|
||||||
while ! mysqladmin ping -h db --silent; do
|
while ! mysqladmin ping -h db --silent; do
|
||||||
# Show some progress
|
# Show some progress
|
||||||
@@ -10,6 +12,7 @@ done
|
|||||||
echo "Ready"
|
echo "Ready"
|
||||||
# Give it another second.
|
# Give it another second.
|
||||||
sleep 1;
|
sleep 1;
|
||||||
|
fi
|
||||||
|
|
||||||
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'
|
||||||
|
|||||||
Reference in New Issue
Block a user