forked from ktkiiski/coffee-pot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
start.sh
37 lines (30 loc) · 858 Bytes
/
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
#!/bin/bash
set -e
# Enable the camera module
modprobe bcm2835-v4l2
# Collect the static files to Amazon S3
python manage.py collectstatic --noinput
# Apply database migrations
python manage.py migrate
# Auto-load fixtures
python manage.py loaddata labels
# Prepare log files and start outputting logs to stdout
mkdir -p /srv/logs
touch /srv/logs/gunicorn.log
touch /srv/logs/access.log
touch /srv/logs/cronjobs.log
touch /srv/logs/reboot.log
tail -n 0 -f /srv/logs/*.log &
# Dump the environment variables to a file, for loading to cron
env > envdump.txt
# Start Gunicorn processes
echo "Starting Gunicorn..."
exec gunicorn barista.wsgi:application \
--name barista \
--bind 0.0.0.0:80 \
--workers 3 \
--timeout 300 \
--log-level=info \
--log-file=/srv/logs/gunicorn.log \
--access-logfile=/srv/logs/access.log \
"$@"