mirror of https://github.com/JohnHammond/CTFd.git
Allow custom MySQL ports in docker entrypoint (#848)
* Allow DATABASE_URL to contain custom MySQL ports for docker-entrypoint.sh * Drop WORKERS count to 1 to avoid dealing with Flask-SocketIO sticky sessionsselenium-screenshot-testing
parent
92e7be224b
commit
06f0715369
|
@ -10,7 +10,7 @@ services:
|
|||
- UPLOAD_FOLDER=/var/uploads
|
||||
- DATABASE_URL=mysql+pymysql://root:ctfd@db/ctfd
|
||||
- REDIS_URL=redis://cache:6379
|
||||
- WORKERS=4
|
||||
- WORKERS=1
|
||||
- LOG_FOLDER=/var/log/CTFd
|
||||
- ACCESS_LOG=-
|
||||
- ERROR_LOG=-
|
||||
|
|
|
@ -18,9 +18,11 @@ fi
|
|||
# Check that the database is available
|
||||
if [ -n "$DATABASE_URL" ]
|
||||
then
|
||||
database=`echo $DATABASE_URL | awk -F[@//] '{print $4}'`
|
||||
echo "Waiting for $database to be ready"
|
||||
while ! mysqladmin ping -h $database --silent; do
|
||||
url=`echo $DATABASE_URL | awk -F[@//] '{print $4}'`
|
||||
database=`echo $url | awk -F[:] '{print $1}'`
|
||||
port=`echo $url | awk -F[:] '{print $2}'`
|
||||
echo "Waiting for $database:$port to be ready"
|
||||
while ! mysqladmin ping -h "$database" -P "$port" --silent; do
|
||||
# Show some progress
|
||||
echo -n '.';
|
||||
sleep 1;
|
||||
|
|
Loading…
Reference in New Issue