docker: add optional DEMO env var

that includes the default snapshot import
This commit is contained in:
pedro 2024-09-24 09:50:57 -03:00
parent 665310651c
commit b024dd1a11
3 changed files with 5 additions and 0 deletions

View File

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

View File

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

View File

@ -24,6 +24,9 @@ deploy() {
./manage.py add_institution example-org
# TODO: one error on add_user, and you don't add user anymore
./manage.py add_user example-org user@example.org 1234
if [ "${DEMO:-}" ]; then
./manage.py up_snapshots example/snapshots/ user@example.org
fi
fi
}