-
Notifications
You must be signed in to change notification settings - Fork 144
/
start.sh
40 lines (30 loc) · 1.56 KB
/
start.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/sh
# start nginx service
#service nginx start
# start celery worker
#celery multi start w1 -A FasterRunner -l info --logfile=./logs/worker.log
#python3 manage.py celery -A FasterRunner.mycelery worker -l info -P solo --settings=FasterRunner.settings.pro --logfile=./logs/worker.log 2>&1 &
# start celery beat
#nohup python3 manage.py celery beat -l info > ./logs/beat.log 2>&1 &
#nohup python3 manage.py FasterRunner.mycelery beat -l info > ./logs/beat.log 2>&1 &
#nohup celery -A FasterRunner.mycelery beat -l info > ./logs/beat.log 2>&1 &
#if [ -f celerybeat.pid ]; then rm celerybeat.pid;fi
#python3 manage.py celery -A FasterRunner.mycelery beat -l info --settings=FasterRunner.settings.pro --logfile=./logs/beat.log 2>&1 &
# start fastrunner
#uwsgi --ini ./uwsgi_docker.ini
#uwsgi --ini ./uwsgi_docker.ini --logto ./logs/uwsgi.log
#gunicorn FasterRunner.wsgi_docker -b 0.0.0.0 -w 4
#python3 manage.py runserver --settings=FasterRunner.settings.docker
if [ $1 = "app" ]; then
echo "start app"
# /usr/local/bin/python -m gunicorn FasterRunner.wsgi_docker -b 0.0.0.0 -w4
/usr/local/bin/python -m gunicorn FasterRunner.wsgi_docker -b 0.0.0.0 -w4 -k gevent
fi
if [ $1 = "celery-worker" ]; then
echo "start celery"
export DJANGO_SETTINGS_MODULE=FasterRunner.settings.docker; /usr/local/bin/python -m celery -A FasterRunner.mycelery worker -l info --concurrency=4
fi
if [ $1 = "celery-beat" ]; then
echo "start celery beat"
export DJANGO_SETTINGS_MODULE=FasterRunner.settings.docker; /usr/local/bin/python -m celery -A FasterRunner.mycelery beat -l info
fi