使用 superivisord 启动进程
This commit is contained in:
21
dockerfiles/judger/Dockerfile
Normal file
21
dockerfiles/judger/Dockerfile
Normal file
@@ -0,0 +1,21 @@
|
||||
FROM ubuntu:14.04
|
||||
MAINTAINER virusdefender<qduliyang@outlook.com>
|
||||
RUN mkdir /var/install/
|
||||
WORKDIR /var/install/
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
RUN rm /etc/apt/sources.list
|
||||
COPY sources.list /etc/apt/
|
||||
RUN apt-get update
|
||||
RUN apt-get -y install software-properties-common python-software-properties
|
||||
RUN add-apt-repository -y ppa:webupd8team/java
|
||||
RUN apt-get update
|
||||
RUN apt-get -y install python gcc g++ rake pkg-config git make autoconf automake libtool python-pip python2.7-mysqldb
|
||||
RUN echo debconf shared/accepted-oracle-license-v1-1 select true | sudo debconf-set-selections
|
||||
RUN echo debconf shared/accepted-oracle-license-v1-1 seen true | sudo debconf-set-selections
|
||||
RUN apt-get install -y oracle-java7-installer
|
||||
RUN apt-get -y install libseccomp-dev
|
||||
RUN git clone https://github.com/quark-zju/lrun.git
|
||||
RUN cd lrun && make install
|
||||
RUN mkdir -p /var/judger/run/ && mkdir /var/judger/test_case/ && mkdir /var/judger/code/
|
||||
RUN chmod -R 777 /var/judger/run/
|
||||
WORKDIR /var/judger/code/
|
||||
10
dockerfiles/judger/sources.list
Normal file
10
dockerfiles/judger/sources.list
Normal file
@@ -0,0 +1,10 @@
|
||||
deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
|
||||
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
|
||||
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
|
||||
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
|
||||
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
|
||||
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
|
||||
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
|
||||
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
|
||||
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
|
||||
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
|
||||
8
dockerfiles/oj_web_server/Dockerfile
Normal file
8
dockerfiles/oj_web_server/Dockerfile
Normal file
@@ -0,0 +1,8 @@
|
||||
FROM python:2.7
|
||||
ENV PYTHONBUFFERED 1
|
||||
RUN mkdir -p /code/log /code/test_case /code/upload
|
||||
WORKDIR /code
|
||||
ADD requirements.txt /code/
|
||||
RUN pip install -r requirements.txt
|
||||
EXPOSE 8010
|
||||
CMD superivisord
|
||||
16
dockerfiles/oj_web_server/gunicorn.conf
Normal file
16
dockerfiles/oj_web_server/gunicorn.conf
Normal file
@@ -0,0 +1,16 @@
|
||||
[program:gunicorn]
|
||||
|
||||
command=gunicorn oj.wsgi:application -b 0.0.0.0:8080 --reload
|
||||
|
||||
directory=/root/qduoj/
|
||||
user=root
|
||||
numprocs=1
|
||||
stdout_logfile=/root/log/gunicorn.log
|
||||
stderr_logfile=/root/log/gunicorn.log
|
||||
autostart=true
|
||||
autorestart=true
|
||||
startsecs=5
|
||||
|
||||
stopwaitsecs = 6
|
||||
|
||||
killasgroup=true
|
||||
16
dockerfiles/oj_web_server/mq.conf
Normal file
16
dockerfiles/oj_web_server/mq.conf
Normal file
@@ -0,0 +1,16 @@
|
||||
[program:mq]
|
||||
|
||||
command=python manage.py runscript mq
|
||||
|
||||
directory=/root/qduoj/
|
||||
user=root
|
||||
numprocs=1
|
||||
stdout_logfile=/root/log/mq.log
|
||||
stderr_logfile=/root/log/mq.log
|
||||
autostart=true
|
||||
autorestart=true
|
||||
startsecs=5
|
||||
|
||||
stopwaitsecs = 6
|
||||
|
||||
killasgroup=true
|
||||
26
dockerfiles/oj_web_server/supervisord.conf
Normal file
26
dockerfiles/oj_web_server/supervisord.conf
Normal file
@@ -0,0 +1,26 @@
|
||||
[unix_http_server]
|
||||
file=/tmp/supervisor.sock ; path to your socket file
|
||||
|
||||
[supervisord]
|
||||
logfile=/root/log/supervisord.log ; supervisord log file
|
||||
logfile_maxbytes=50MB ; maximum size of logfile before rotation
|
||||
logfile_backups=10 ; number of backed up logfiles
|
||||
loglevel=info ; info, debug, warn, trace
|
||||
pidfile=/root/log/supervisord.pid ; pidfile location
|
||||
nodaemon=false ; run supervisord as a daemon
|
||||
minfds=1024 ; number of startup file descriptors
|
||||
minprocs=200 ; number of process descriptors
|
||||
user=root ; default user
|
||||
childlogdir=/root/log/ ; where child log files will live
|
||||
|
||||
|
||||
[rpcinterface:supervisor]
|
||||
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
|
||||
|
||||
[supervisorctl]
|
||||
serverurl=unix:///tmp/supervisor.sock ; use unix:// schem for a unix sockets.
|
||||
|
||||
|
||||
[include]
|
||||
|
||||
files=*.conf
|
||||
Reference in New Issue
Block a user