blob: fbeb6ac7bea1db606a877ea776cbe6cf0302b0c5 [file] [log] [blame]
vitalygusev507dfdb2019-05-28 12:53:55 +04001#!/bin/sh
2
3export SIMPLE_SETTINGS=${SIMPLE_SETTINGS:-sf_notifier.settings.production}
4export SF_NOTIFIER_ALERT_ID_HASH_FUNC=${SF_NOTIFIER_ALERT_ID_HASH_FUNC:-sha256}
5
6WORKERS=${SF_NOTIFIER_WORKERS:-4}
7BUFFER=${SF_NOTIFIER_BUFFER_SIZE:-32768}
8PORT=${SF_NOTIFIER_APP_PORT:-5000}
9CACHE_ITEMS=${SF_NOTIFIER_CACHE_ITEMS:-300}
10CACHE_FILE=${SF_NOTIFIER_CACHE_FILE:-/tmp/cachefile}
11
12mkdir -p /var/log/sf-notifier
13chown -R 999:999 /var/log/sf-notifier
14
15MULES=$(for _ in $(seq 1 $WORKERS); do
16 echo "--mule "
17done)
18
19uwsgi -p 4 \
20 --uid 999 \
21 --gid 999 \
22 --http 0.0.0.0:${PORT} \
23 --wsgi-file sf_notifier/server.py \
24 --callable app_dispatch \
25 --buffer-size=${BUFFER} \
26 --max-worker-lifetime 300 \
27 --cache2 name=mycache,items=${CACHE_ITEMS},store=${CACHE_FILE},store_sync=10 \
28 ${MULES} \
29 --master