Skip to content

Commit 2c5aca3

Browse files
committed
Allow to start wirecloud image using the --user flag
Thanks to fiware-austria for the help.
1 parent 12aa27b commit 2c5aca3

4 files changed

Lines changed: 22 additions & 4 deletions

File tree

1.2/docker-entrypoint.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ case "$1" in
2525
manage.py migrate --fake-initial
2626
manage.py populate
2727

28-
gosu wirecloud /usr/local/bin/gunicorn wirecloud_instance.wsgi:application --forwarded-allow-ips "${FORWARDED_ALLOW_IPS}" -w 2 -b :8000
28+
# allow the container to be started with `--user`
29+
if [ "$(id -u)" = '0' ]; then
30+
gosu wirecloud /usr/local/bin/gunicorn wirecloud_instance.wsgi:application --forwarded-allow-ips "${FORWARDED_ALLOW_IPS}" -w 2 -b :8000
31+
else
32+
/usr/local/bin/gunicorn wirecloud_instance.wsgi:application --forwarded-allow-ips "${FORWARDED_ALLOW_IPS}" -w 2 -b :8000
33+
fi
2934
;;
3035
esac

1.2/manage.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
#!/usr/bin/env bash
22
cd /opt/wirecloud_instance
3-
gosu wirecloud python manage.py $@
3+
if [ "$(id -u)" = '0' ]; then
4+
gosu wirecloud python manage.py $@
5+
else
6+
python manage.py $@
7+
fi

dev/docker-entrypoint.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ case "$1" in
2525
manage.py migrate --fake-initial
2626
manage.py populate
2727

28-
gosu wirecloud /usr/local/bin/gunicorn wirecloud_instance.wsgi:application --forwarded-allow-ips "${FORWARDED_ALLOW_IPS}" -w 2 -b :8000
28+
# allow the container to be started with `--user`
29+
if [ "$(id -u)" = '0' ]; then
30+
gosu wirecloud /usr/local/bin/gunicorn wirecloud_instance.wsgi:application --forwarded-allow-ips "${FORWARDED_ALLOW_IPS}" -w 2 -b :8000
31+
else
32+
/usr/local/bin/gunicorn wirecloud_instance.wsgi:application --forwarded-allow-ips "${FORWARDED_ALLOW_IPS}" -w 2 -b :8000
33+
fi
2934
;;
3035
esac

dev/manage.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
#!/usr/bin/env bash
22
cd /opt/wirecloud_instance
3-
gosu wirecloud python manage.py $@
3+
if [ "$(id -u)" = '0' ]; then
4+
gosu wirecloud python manage.py $@
5+
else
6+
python manage.py $@
7+
fi

0 commit comments

Comments
 (0)