edgedb / edgedb-docker

Official Docker Image packaging for EdgeDB
83 stars 16 forks source link

New setup of dockerfile #11

Closed tailhook closed 3 years ago

tailhook commented 3 years ago

This is largely untested for now.

  1. Add support of docker-entrypoints.d (fixes #3). Scripts are run by a user passed to docker (root by default).
  2. If /edgedb-bootstrap.edgeql exists, use it as --bootstrap-script
  3. Else, if EDGEB_BOOTSTRAP_COMMAND exists, pass it as --bootstrap-command
  4. Else, if EDGEDB_PASSWORD_HASH exists, create EDGEDB_USER or set that password for user edgedb (uses encoded password)
  5. Else, if EDGEDB_PASSWORD exists, create EDGEDB_USER or set password (this is to share settings in docker-compose.yaml easier)
  6. If EDGEDB_DATABASE is not edgedb create that database
  7. Run all /edgedb-bootstrap/*.sh scripts after configuration above (and before restarting the database). Scripts are run as edgedb user if container is run by root.
  8. Execute all /edgedb-bootstrap/*.edgeql scripts, all of them are executed in the context of EDGEDB_DATABASE.
  9. If /dbschema exists. Run edgedb migrate as part of script.

    It's largely untested now. Will be testing it tomorrow.

tailhook commented 3 years ago

This is kinda done. Changes are:

  1. ONBUILD fails, because it requires something to copy from, so it's not good. Removed that.
  2. (2) and (3) from the original topics work not very well. I.e. if you have either /edgedb-bootstrap.edgeql or EDGEDB_BOOTSTRAP_COMMAND and EDGEDB_USER / EDGEDB_PASSWORD the problem is that the latter environment variables are used for edgedb CLI in entrypoint script and if that user is not created the script fails. I'm not sure if we have to do something about this, though.
tailhook commented 3 years ago

~Also, I'm not sure why tests are hanging here. They work fine locally.~ Work fine now.