Michal Kobus | 492d8bc | 2021-02-15 16:54:13 +0100 | [diff] [blame] | 1 | #!/bin/ash |
vitalygusev | 507dfdb | 2019-05-28 12:53:55 +0400 | [diff] [blame] | 2 | |
| 3 | export SIMPLE_SETTINGS=${SIMPLE_SETTINGS:-sf_notifier.settings.production} |
Michal Kobus | 2e85ef8 | 2021-06-24 18:01:43 +0200 | [diff] [blame] | 4 | export LOGPATH=/var/log/sf-notifier/sfnotifier.log |
vitalygusev | 507dfdb | 2019-05-28 12:53:55 +0400 | [diff] [blame] | 5 | |
| 6 | WORKERS=${SF_NOTIFIER_WORKERS:-4} |
| 7 | BUFFER=${SF_NOTIFIER_BUFFER_SIZE:-32768} |
| 8 | PORT=${SF_NOTIFIER_APP_PORT:-5000} |
vitalygusev | 507dfdb | 2019-05-28 12:53:55 +0400 | [diff] [blame] | 9 | |
Michal Kobus | 2e85ef8 | 2021-06-24 18:01:43 +0200 | [diff] [blame] | 10 | mkdir -p `dirname $LOGPATH` |
| 11 | touch $LOGPATH |
| 12 | chown -R 1000:1000 `dirname $LOGPATH` |
vitalygusev | 507dfdb | 2019-05-28 12:53:55 +0400 | [diff] [blame] | 13 | |
Michal Kobus | aa3accf | 2019-06-05 12:25:09 +0200 | [diff] [blame] | 14 | uwsgi -p ${WORKERS} \ |
Michal Kobus | 492d8bc | 2021-02-15 16:54:13 +0100 | [diff] [blame] | 15 | --uid 1000 \ |
| 16 | --gid 1000 \ |
vitalygusev | 507dfdb | 2019-05-28 12:53:55 +0400 | [diff] [blame] | 17 | --http 0.0.0.0:${PORT} \ |
| 18 | --wsgi-file sf_notifier/server.py \ |
| 19 | --callable app_dispatch \ |
| 20 | --buffer-size=${BUFFER} \ |
| 21 | --max-worker-lifetime 300 \ |
Michal Kobus | 2e85ef8 | 2021-06-24 18:01:43 +0200 | [diff] [blame] | 22 | --master \ |
| 23 | --req-logger=file:${LOGPATH} |