mirror of
https://github.com/QingdaoU/JudgeServer.git
synced 2025-11-04 14:50:01 +08:00
use entrypoint
This commit is contained in:
parent
c67187cccf
commit
8af9bac471
@ -19,4 +19,4 @@ HEALTHCHECK --interval=5s --retries=3 CMD python /code/service.py
|
|||||||
ADD server /code
|
ADD server /code
|
||||||
WORKDIR /code
|
WORKDIR /code
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
CMD /bin/bash /code/run.sh
|
ENTRYPOINT /code/entrypoint.sh
|
||||||
|
|||||||
@ -53,7 +53,7 @@ class JudgeServerClient(object):
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
token = "123456"
|
token = "YOUR_TOKEN_HERE"
|
||||||
|
|
||||||
c_src = r"""
|
c_src = r"""
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|||||||
2
server/run.sh → server/entrypoint.sh
Normal file → Executable file
2
server/run.sh → server/entrypoint.sh
Normal file → Executable file
@ -1,7 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
chown compiler:compiler /spj
|
chown compiler:compiler /spj
|
||||||
echo 0 > /tmp/counter
|
|
||||||
core=$(grep --count ^processor /proc/cpuinfo)
|
core=$(grep --count ^processor /proc/cpuinfo)
|
||||||
n=$(($core*2))
|
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
|
exec gunicorn --workers $n --threads $n --error-logfile /log/gunicorn.log --time 600 --bind 0.0.0.0:8080 server:wsgiapp
|
||||||
Loading…
Reference in New Issue
Block a user