If we l examine https://github.com/allegro/ralph/tree/ng/docker, there is a docker-entrypoint.sh file which then calls init-ralph.sh, whose last few lines look like this:
"${RALPH_LOCAL_DIR}/wait-for-it.sh" "${DATABASE_HOST}:${DATABASE_PORT}" --timeout=30 --strict -- echo "Database is up"
ralph migrate --noinput
ralph sitetree_resync_apps
if [[ "$COMMAND" == "init" ]]; then
python3 "${RALPH_LOCAL_DIR}/createsuperuser.py"
fi
When I start running it, I see
[raub@vmhost2 ralph-ng]$ docker-compose run --rm web init
Creating network "ralph-ng_default" with the default driver
Creating ralph-ng_nginx_1 ... done
Creating ralph-ng_db_1 ... done
Creating ralph-ng_redis_1 ... done
wait-for-it.sh: waiting 30 seconds for db:3306
wait-for-it.sh: db:3306 is available after 0 seconds
Database is up
Operations to perform:
Synchronize unmigrated apps: staticfiles, dc_view, table, permissions, rest_framework, humanize, notifications, taggit_serializer, foundation, import_export, django_rq, djmoney, ralph_admin, mptt, hooks, messages
Apply all migrations: deployment, accounts, contenttypes, external_services, access_cards, trade_marks, admin, auth, taggit, virtual, attachments, operations,data_importer, sessions, domains, reversion, supports, sitetree, custom_fields,sim_cards, dhcp, configuration_management, networks, security, dashboards, transitions, ssl_certificates, data_center, reports, assets, authtoken, licences, back_office
Synchronizing apps without migrations:
[...]
Adding `Add warehouse` tree item ...
Adding `{{ original }}` tree item ...
Adding `Office Infrastructures` tree item ...
Adding `Add office infrastructure` tree item ...
Adding `{{ original }}` tree item ...
[raub@vmhost2 ralph-ng]$
But I am not seeing the if[] command on the very end being called. Am I missing something? Is there a different docker-entrypoint.sh in the image being called?