use entrypoint

This commit is contained in:
virusdefender 2017-12-22 14:02:37 +08:00
parent c67187cccf
commit 8af9bac471
3 changed files with 2 additions and 4 deletions

View File

@ -19,4 +19,4 @@ HEALTHCHECK --interval=5s --retries=3 CMD python /code/service.py
ADD server /code
WORKDIR /code
EXPOSE 8080
CMD /bin/bash /code/run.sh
ENTRYPOINT /code/entrypoint.sh

View File

@ -53,7 +53,7 @@ class JudgeServerClient(object):
if __name__ == "__main__":
token = "123456"
token = "YOUR_TOKEN_HERE"
c_src = r"""
#include <stdio.h>

2
server/run.sh → server/entrypoint.sh Normal file → Executable file
View File

@ -1,7 +1,5 @@
#!/usr/bin/env bash
chown compiler:compiler /spj
echo 0 > /tmp/counter
core=$(grep --count ^processor /proc/cpuinfo)
n=$(($core*2))
chmod 400 /tmp/counter
exec gunicorn --workers $n --threads $n --error-logfile /log/gunicorn.log --time 600 --bind 0.0.0.0:8080 server:wsgiapp