OnlineJudge/dockerfiles/oj_web_server/run.sh
2016-02-20 13:57:14 +08:00

12 lines
464 B
Bash

#!/usr/bin/env bash
if [ ! -f "/code/oj/custom_settings.py" ]; then
cp /code/oj/custom_settings.example.py /code/oj/custom_settings.py
echo "SECRET_KEY=\"`cat /dev/urandom | head -1 | md5sum | head -c 32`\"" >> /code/oj/custom_settings.py
fi
find /code -name "*.pyc" -delete
python -m compileall /code
chown -R nobody:nogroup /code/log /code/test_case /code/upload
echo "Waiting MySQL and Redis to start"
sleep 10
python /code/tools/create_db.py
exec supervisord