From fe115969b08311840dfcf55e0dcf6f7e789835f5 Mon Sep 17 00:00:00 2001 From: virusdefender Date: Mon, 3 Oct 2016 17:30:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E9=99=A4supervisor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 8 ++++---- deploy/supervisord.conf | 20 -------------------- 2 files changed, 4 insertions(+), 24 deletions(-) delete mode 100644 deploy/supervisord.conf diff --git a/Dockerfile b/Dockerfile index 652033e..6c29a43 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,9 +14,9 @@ RUN mkdir /var/wp RUN pip install psutil gunicorn web.py requests RUN mkdir -p /judger_run /test_case /log /code COPY deploy/java_policy /etc -COPY deploy/supervisord.conf /etc RUN chmod -R 777 /judger_run -RUN pip install supervisor psutil gunicorn web.py -EXPOSE 8080 +RUN pip install futures psutil gunicorn web.py HEALTHCHECK --interval=5s --retries=3 CMD python /code/service.py -CMD exec supervisord +WORKDIR /code +EXPOSE 8080 +CMD gunicorn --workers 4 --threads 4 --error-logfile /log/gunicorn.log --bind 0.0.0.0:8080 server:wsgiapp diff --git a/deploy/supervisord.conf b/deploy/supervisord.conf deleted file mode 100644 index 7ade2fe..0000000 --- a/deploy/supervisord.conf +++ /dev/null @@ -1,20 +0,0 @@ -[supervisord] -logfile=/log/judger_supervisord.log -logfile_maxbytes=50MB -logfile_backups=10 -loglevel=info -pidfile=/log/judger_supervisord.pid -nodaemon=true -childlogdir=/log/ - -[program:judger_server] -command=gunicorn -w 4 -b 0.0.0.0:8080 server:wsgiapp -directory=/code -numprocs=1 -stdout_logfile=/log/judger_server.log -stderr_logfile=/log/judger_server.log -autostart=true -autorestart=true -startsecs=5 -stopwaitsecs = 5 -killasgroup=true \ No newline at end of file