-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simple db init with docker #629
Conversation
Allow sending rd_ui/dist, remove rd_ui/nodemodules.
- No need to pg client anymore. - Fix path to supervisord.conf.
…rent code base as context
Should close #628 |
And sorry for the delay in reviewing this... |
1. About the REDASH_DATABASE_* variables:This is in deed the controversial part of my commit. I need access to both superuser and redashuser on the database. I didn't like the idea to repeat hostname/database name, and to let them be different. But if you don't like the idea, I can change that to REDASH_DATABASE_URL and REDASH_DATABASE_ADMIN_URL. 2. About manage.pyI'm not used to flask development and conventions. I'll take a look at it. Doesn't seems complex, but I might end up violating flask best practices... |
By the way, I put the files in the docker folder, but there is nothing related to docker in those files, they might be used to init database on other environments too. |
would be really nice if we could merge this and get a proper docker(-compose) setup. I got it working for now, but it was really a PITA to get started. |
I added to re:dash the following parameters:
They are to be used instead of REDASH_DATABASE_URL. REDASH_DATABASE_URL still works and override REDASH_DATABASE_* other keys, so it should not be used if REDASH_DATABASE_* are used.
So given the re:dash main container is used with those keys, if you start the re:dash init container with the same image, with
/init.sh
as command and with the following env var set, it will create the database you need, the role (user), grant access to the new role, create tables, and populate tables.The new init env var:
(DEFAULT_ADMIN is the properties used to create the first user in re:dash database)
typical usage would be:
The init script will do the following:
The "init" container "best practices":