simonw / django-sql-dashboard

Django app for building dashboards using raw SQL queries
https://django-sql-dashboard.datasette.io/
Apache License 2.0
437 stars 37 forks source link

Research: what would a docker container of this look like? #129

Open simonw opened 3 years ago

simonw commented 3 years ago

This has made me think that maybe a cool ability would be if you could run a pre-compiled Django SQL Dashboard in its own Docker container and point it at an existing PostgreSQL database via an environment variable...

Originally posted by @simonw in https://github.com/simonw/django-sql-dashboard/issues/128#issuecomment-859672378

simonw commented 3 years ago

Imagine if you could run Django SQL Dashboard in a self-contained Docker container and point it at a PostgreSQL database:

docker run -p 8000:8000 \
  -e DASHBOARD_DATABASE="postgres://...." \
  django-sql-dashboard

There are a few challenges with this:

One possible solution: pass in two environment variables - one for the dashboard database (PostgreSQL only, at least until #49) and one for the authentication and saved dashboards database (any supported Django connection string) - the latter option could even work with a SQLite file mounted in a container volume.

simonw commented 3 years ago

Could also handle authentication using a single-use login token similar to "datasette --root"