Use the new "init-admin" command to initialize the database and fallback to the standard postgresql initialization.
The database creation is delegated to the postgresql entrypoint, the extensions and the tables are configured respectively by the init-admin and init commands.
Using this, we can execute the "init-admin" command at each start which can be useful when new super-user migrations are added.
Example of a restart:
swh-scheduler_1 | Creating extensions... swh-scheduler_1 | psql:/srv/softwareheritage/venv/lib/python3.7/site-packages/swh/scheduler/sql/10-superuser-init.sql:1: NOTICE: extension "uuid-ossp" already exists, skipping swh-scheduler_1 | Initializing the database... swh-scheduler_1 | DONE database for scheduler exists at version 17 swh-scheduler_1 | Starting the swh-scheduler API server