File tree Expand file tree Collapse file tree 4 files changed +15
-17
lines changed Expand file tree Collapse file tree 4 files changed +15
-17
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,11 @@ source venv/bin/activate
9
9
pip3 install -r requirements.txt
10
10
```
11
11
12
- - __ install docker__
12
+ - __ install required programs__
13
+
14
+ ```
15
+ sudo apt install redis supervisor nginx
16
+ ```
13
17
14
18
## run
15
19
Original file line number Diff line number Diff line change @@ -8,14 +8,22 @@ nodaemon=true
8
8
childlogdir=%(ENV_WORKDIR)s/data/log
9
9
10
10
[inet_http_server]
11
- port=127 .0.0.1 :9005
11
+ port=0 .0.0.0 :9005
12
12
13
13
[rpcinterface:supervisor]
14
14
supervisor.rpcinterface_factory=supervisor.rpcinterface:make_main_rpcinterface
15
15
16
16
[supervisorctl]
17
17
serverurl=http://0.0.0.0:9005
18
18
19
+ [program:redis]
20
+ command=redis-server --port 6380
21
+ directory=%(ENV_WORKDIR)s
22
+ stdout_logfile=%(ENV_WORKDIR)s/data/log/redis.log
23
+ stderr_logfile=%(ENV_WORKDIR)s/data/log/redis.log
24
+ autostart=true
25
+ autorestart=true
26
+
19
27
[program:gunicorn]
20
28
command=gunicorn onl.wsgi --bind 0.0.0.0:7890 --workers %(ENV_MAX_WORKER_NUM)s --threads 4 --max-requests-jitter 10000 --max-requests 1000000 --keep-alive 32 --access-logfile - --error-logfile -
21
29
directory=%(ENV_WORKDIR)s
Original file line number Diff line number Diff line change @@ -44,20 +44,6 @@ function run_onl {
44
44
workdir=$( pwd)
45
45
process_num=$(( $(nproc) * 2 - 1 ))
46
46
47
- # run redis
48
- if ! command docker container ls | grep redis > /dev/null; then
49
- echo " running redis in docker ..."
50
- if ! command docker ps -a | grep redis > /dev/null; then
51
- docker run -it -d -p 6380:6379 --name oj-redis-dev redis:4.0-alpine > /dev/null
52
- else
53
- container_id=$( docker ps -a | grep redis | awk ' {print $1}' )
54
- docker container start $container_id > /dev/null
55
- fi
56
- [[ $? -ne 0 ]] && echo " Error: fail to run redis docker"
57
- else
58
- echo " redis is already running"
59
- fi
60
-
61
47
# run onl
62
48
if ! command pgrep -f " $supervisor_cmd " > /dev/null; then
63
49
echo " running onl controller ..."
Original file line number Diff line number Diff line change 37
37
# }
38
38
REDIS_CONF = {
39
39
"host" : get_env ("REDIS_HOST" , "oj-redis" ),
40
- "port" : get_env ("REDIS_PORT" , "6379 " )
40
+ "port" : get_env ("REDIS_PORT" , "6380 " )
41
41
}
42
42
DEBUG = False
43
43
ALLOWED_HOSTS = ['*' ]
You can’t perform that action at this time.
0 commit comments