mirror of
https://github.com/QingdaoU/JudgeServer.git
synced 2024-12-29 14:11:44 +00:00
21 lines
434 B
Bash
Executable File
21 lines
434 B
Bash
Executable File
#!/bin/sh
|
|
set -ex
|
|
|
|
rm -rf /judger/*
|
|
mkdir -p /judger/run /judger/spj
|
|
|
|
chown compiler:code /judger/run
|
|
chmod 711 /judger/run
|
|
|
|
chown compiler:spj /judger/spj
|
|
chmod 710 /judger/spj
|
|
|
|
CPU_CORE_NUM="$(nproc)"
|
|
if [ "$CPU_CORE_NUM" -lt 2 ]; then
|
|
export WORKER_NUM=2;
|
|
else
|
|
export WORKER_NUM="$CPU_CORE_NUM";
|
|
fi
|
|
|
|
exec .venv/bin/gunicorn server:app --workers $WORKER_NUM --threads 4 --error-logfile /log/gunicorn.log --bind 0.0.0.0:8080
|