-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathentrypoint.sh
More file actions
24 lines (16 loc) · 688 Bytes
/
entrypoint.sh
File metadata and controls
24 lines (16 loc) · 688 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env bash
EMBEDED_DB=${EMBEDED_DB:-}
if [ -n "$EMBEDED_DB" ]; then
echo "[*] Starting embedded MongoDB database"
/usr/local/mongodb/bin/mongod --dbpath /data/db/mongo 2> /dev/null > /dev/null &
sleep 5
echo "[*] Starting embedded Redis database"
redis-server 2> /dev/null > /dev/null &
export MONGO_URI=mongodb://127.0.0.1:27017
export REDIS_URI=redis://127.0.0.1:6379/0
fi
echo "[*] Creating MongoDB Indexes"
export FLASK_APP=easy_logs.app
flask create-mongo-indexes
echo "[*] Starting EasyLogs"
exec gunicorn --bind :8080 -w 1 -c gunicorn.conf.py --worker-class gevent --timeout 0 --backlog 1024 --worker-connections 2048 easy_logs.app:app