-
Notifications
You must be signed in to change notification settings - Fork 4
/
startup.sh
31 lines (26 loc) · 1.12 KB
/
startup.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
#!/usr/bin/env bash
if [ ! -f data/settings.ini ]; then
echo "settings.ini did not exist, copyingfrom settings.ini.template"
cp settings.ini.template data/settings.ini || { echo "settings.ini.template missing."; exit 1; }
fi
source <(grep pacmanrepo_name data/settings.ini | tr -d ' ')
export pacmanrepo_name
[ -f pacman.conf.tmpl ] || { echo 'pacman.conf.tmpl is missing.'; exit 1; }
envsubst '$pacmanrepo_name' < pacman.conf.tmpl > /etc/pacman.conf
[ -f makepkg/docker/pacman.conf.tmpl ] || { echo 'makepkg/docker/pacman.conf.tmpl is missing.'; exit 1; }
envsubst '$pacmanrepo_name' < makepkg/docker/pacman.conf.tmpl > makepkg/docker/pacman.conf
python manage.py migrate
python manage.py crontab add
if ! grep -r -i -q "debug = true" data/settings.ini; then
echo "Starting syslog:"
syslog-ng --no-caps
echo "Starting crond:"
crond -s
echo "Starting Django:"
#Start with gunicorn
python manage.py collectstatic --noinput
gunicorn --bind :8000 --workers 3 abs_cd.wsgi:application
else
echo "WARNING: DEBUG is set to TRUE! Don't use this in production";
python manage.py runserver 0.0.0.0:8000
fi