Compare commits

..

No commits in common. "bab540187c21cfd08949ae401ece19b4da9254b5" and "665310651c3005ee00226c1be762fc66dd65f899" have entirely different histories.

3 changed files with 4 additions and 13 deletions

View file

@ -1,2 +1 @@
DOMAIN=localhost
DEMO=false

View file

@ -6,7 +6,6 @@ services:
environment:
- DEBUG=true
- DOMAIN=${DOMAIN:-localhost}
- DEMO=${DEMO:-n}
volumes:
- .:/opt/devicehub-django
ports:

View file

@ -21,28 +21,21 @@ deploy() {
# inspired by https://medium.com/analytics-vidhya/django-with-docker-and-docker-compose-python-part-2-8415976470cc
echo "INFO detected NEW deployment"
./manage.py migrate
INIT_ORG="${INIT_ORG:-example-org}"
INIT_USER="${INIT_USER:-user@example.org}"
INIT_PASSWD="${INIT_PASSWD:-1234}"
./manage.py add_institution "${INIT_ORG}"
./manage.py add_institution example-org
# TODO: one error on add_user, and you don't add user anymore
./manage.py add_user "${INIT_ORG}" "${INIT_USER}" "${INIT_PASSWD}"
if [ "${DEMO:-}" ]; then
./manage.py up_snapshots example/snapshots/ "${INIT_USER}"
fi
./manage.py add_user example-org user@example.org 1234
fi
}
runserver() {
PORT="${PORT:-8000}"
if [ "${DEBUG:-}" ]; then
if [ "${DEBUG:-}" = "true" ]; then
./manage.py runserver 0.0.0.0:${PORT}
else
# TODO
#./manage.py collectstatic
true
if [ "${EXPERIMENTAL:-}" ]; then
if [ "${EXPERIMENTAL:-}" = "true" ]; then
# TODO
# 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