增加部分配置文件模板

This commit is contained in:
virusdefender 2016-04-27 21:16:45 +08:00
parent e73903a934
commit e53da8c2b3
No known key found for this signature in database
GPG Key ID: 1686FB5677979E61
6 changed files with 51 additions and 1 deletions

View File

@ -0,0 +1,8 @@
FROM python:3.5
ENV PYTHONBUFFERED 1
RUN mkdir -p /code /code/log
COPY requirements.txt /tmp
RUN pip install -i http://pypi.douban.com/simple -r /tmp/requirements.txt --trusted-host pypi.douban.com
ADD supervisord.conf /etc
EXPOSE 8080
CMD bash /code/dockerfile/run.sh

View File

@ -3,4 +3,6 @@ pymysql
celery
requests
djangorestframework
redis
redis
supervisor
gunicorn

1
dockerfile/server/run.sh Normal file
View File

@ -0,0 +1 @@
#!/usr/bin/env bash

View File

@ -0,0 +1,38 @@
[supervisord]
logfile=/code/log/supervisord.log
logfile_maxbytes=50MB
logfile_backups=10
loglevel=info
pidfile=/code/log/supervisord.pid
nodaemon=true
user=nobody
childlogdir=/code/log/
[supervisorctl]
serverurl=unix:///tmp/supervisor.sock
[program:gunicorn]
command=gunicorn openvj.wsgi:application -b 0.0.0.0:8080 --reload
directory=/code/
user=nobody
numprocs=1
stdout_logfile=/code/log/gunicorn.log
stderr_logfile=/code/log/gunicorn.log
autostart=true
autorestart=true
startsecs=5
stopwaitsecs = 5
killasgroup=true
[program:celery]
command=celery -A openvj worker -l DEBUG -Q local
directory=/code/
user=nobody
numprocs=1
stdout_logfile=/code/log/celery_local.log
stderr_logfile=/code/log/celery_local.log
autostart=true
autorestart=true
startsecs=5
stopwaitsecs = 5
killasgroup=true

View File

@ -0,0 +1 @@
SECRET_KEY = ""