mirror of
https://github.com/aljazceru/CTFd.git
synced 2025-12-17 05:54:19 +01:00
* docker-compose improvements
* Use gevent gunicorn workers
* Makes logs easier to access
* Customization of the logs location
* Improve secret key generation & only generate secret keys if one isn't defined (Closes #123)
* Install requirements required by plugins
24 lines
570 B
Bash
Executable File
24 lines
570 B
Bash
Executable File
#!/bin/sh
|
|
|
|
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;
|
|
fi
|
|
|
|
echo "Starting CTFd"
|
|
gunicorn 'CTFd:create_app()' \
|
|
--bind '0.0.0.0:8000' \
|
|
--workers 1 \
|
|
--worker-class 'gevent' \
|
|
--access-logfile "${LOG_FOLDER:-/opt/CTFd/CTFd/logs}/access.log" \
|
|
--error-logfile "${LOG_FOLDER:-/opt/CTFd/CTFd/logs}/error.log"
|