docker: better idhub entrypoint

This commit is contained in:
pedro 2025-02-11 16:06:41 +01:00
parent 052ee0f2b5
commit 198e4def60

View file

@ -17,8 +17,10 @@ END
inject_env_vars() { inject_env_vars() {
# related https://www.kenmuse.com/blog/avoiding-dubious-ownership-in-dev-containers/ # related https://www.kenmuse.com/blog/avoiding-dubious-ownership-in-dev-containers/
git config --global --add safe.directory "${idhub_dir}" if [ -d "${idhub_dir}/.git" ]
export COMMIT="commit: $(git log --pretty=format:'%h' -n 1)" git config --global --add safe.directory "${idhub_dir}"
export COMMIT="commit: $(git log --pretty=format:'%h' -n 1)"
fi
cat > status_data <<END cat > status_data <<END
DOMAIN=${DOMAIN} DOMAIN=${DOMAIN}
@ -118,7 +120,8 @@ runserver() {
elif [ "${DEMO:-}" = 'true' ]; then elif [ "${DEMO:-}" = 'true' ]; then
VAULT_PASSWORD="DEMO" VAULT_PASSWORD="DEMO"
# open_service: automatically unlocks the vault, # open_service: automatically unlocks the vault,
# useful for debugging/dev purposes ./manage.py # and runs the service
# useful for debugging/dev/demo purposes ./manage.py
./manage.py open_service "${VAULT_PASSWORD}" 0.0.0.0:${PORT} ./manage.py open_service "${VAULT_PASSWORD}" 0.0.0.0:${PORT}
else else
./manage.py runserver 0.0.0.0:${PORT} ./manage.py runserver 0.0.0.0:${PORT}