-
Notifications
You must be signed in to change notification settings - Fork 15
/
docker-entrypoint.sh
executable file
·45 lines (41 loc) · 1.36 KB
/
docker-entrypoint.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
38
39
40
41
42
43
44
45
#!/bin/bash
set -e
# allow the container to be started with `--user`
if [ "$(id -u)" = '0' ]; then
chown -R wirecloud data
chown -R wirecloud /var/www/static
fi
# Real entry point
case "$1" in
initdb)
manage.py migrate --fake-initial
manage.py populate
;;
createdefaultsuperuser)
echo "from django.contrib.auth.models import User; User.objects.create_superuser('admin', '[email protected]', 'admin')" | manage.py shell > /dev/null
;;
createsuperuser)
manage.py createsuperuser
;;
*)
manage.py collectstatic --noinput
manage.py migrate --fake-initial
manage.py populate
# allow the container to be started with `--user`
if [ "$(id -u)" = '0' ]; then
exec gosu wirecloud /usr/local/bin/gunicorn wirecloud_instance.wsgi:application \
--forwarded-allow-ips "${FORWARDED_ALLOW_IPS}" \
--workers 2 \
--bind 0.0.0.0:8000 \
--log-file - \
--log-level ${LOGLEVEL}
else
exec /usr/local/bin/gunicorn wirecloud_instance.wsgi:application \
--forwarded-allow-ips "${FORWARDED_ALLOW_IPS}" \
--workers 2 \
--bind 0.0.0.0:8000 \
--log-file - \
--log-level ${LOGLEVEL}
fi
;;
esac