Compare commits
No commits in common. "bab540187c21cfd08949ae401ece19b4da9254b5" and "665310651c3005ee00226c1be762fc66dd65f899" have entirely different histories.
bab540187c
...
665310651c
|
@ -1,2 +1 @@
|
||||||
DOMAIN=localhost
|
DOMAIN=localhost
|
||||||
DEMO=false
|
|
||||||
|
|
|
@ -6,7 +6,6 @@ services:
|
||||||
environment:
|
environment:
|
||||||
- DEBUG=true
|
- DEBUG=true
|
||||||
- DOMAIN=${DOMAIN:-localhost}
|
- DOMAIN=${DOMAIN:-localhost}
|
||||||
- DEMO=${DEMO:-n}
|
|
||||||
volumes:
|
volumes:
|
||||||
- .:/opt/devicehub-django
|
- .:/opt/devicehub-django
|
||||||
ports:
|
ports:
|
||||||
|
|
|
@ -21,28 +21,21 @@ deploy() {
|
||||||
# inspired by https://medium.com/analytics-vidhya/django-with-docker-and-docker-compose-python-part-2-8415976470cc
|
# inspired by https://medium.com/analytics-vidhya/django-with-docker-and-docker-compose-python-part-2-8415976470cc
|
||||||
echo "INFO detected NEW deployment"
|
echo "INFO detected NEW deployment"
|
||||||
./manage.py migrate
|
./manage.py migrate
|
||||||
INIT_ORG="${INIT_ORG:-example-org}"
|
./manage.py add_institution example-org
|
||||||
INIT_USER="${INIT_USER:-user@example.org}"
|
|
||||||
INIT_PASSWD="${INIT_PASSWD:-1234}"
|
|
||||||
./manage.py add_institution "${INIT_ORG}"
|
|
||||||
# TODO: one error on add_user, and you don't add user anymore
|
# TODO: one error on add_user, and you don't add user anymore
|
||||||
./manage.py add_user "${INIT_ORG}" "${INIT_USER}" "${INIT_PASSWD}"
|
./manage.py add_user example-org user@example.org 1234
|
||||||
|
|
||||||
if [ "${DEMO:-}" ]; then
|
|
||||||
./manage.py up_snapshots example/snapshots/ "${INIT_USER}"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
runserver() {
|
runserver() {
|
||||||
PORT="${PORT:-8000}"
|
PORT="${PORT:-8000}"
|
||||||
if [ "${DEBUG:-}" ]; then
|
if [ "${DEBUG:-}" = "true" ]; then
|
||||||
./manage.py runserver 0.0.0.0:${PORT}
|
./manage.py runserver 0.0.0.0:${PORT}
|
||||||
else
|
else
|
||||||
# TODO
|
# TODO
|
||||||
#./manage.py collectstatic
|
#./manage.py collectstatic
|
||||||
true
|
true
|
||||||
if [ "${EXPERIMENTAL:-}" ]; then
|
if [ "${EXPERIMENTAL:-}" = "true" ]; then
|
||||||
# TODO
|
# TODO
|
||||||
# reloading on source code changing is a debugging future, maybe better then use debug
|
# reloading on source code changing is a debugging future, maybe better then use debug
|
||||||
# src https://stackoverflow.com/questions/12773763/gunicorn-autoreload-on-source-change/24893069#24893069
|
# src https://stackoverflow.com/questions/12773763/gunicorn-autoreload-on-source-change/24893069#24893069
|
||||||
|
|
Loading…
Reference in a new issue