The purpose of this repository is to provide a convenient setup for a lightweight data exploration stack using Docker. The stack includes the following components:
- PostgreSQL database: Used for storing the data to be analysed.
- PostgreSQL database: Serves as the application database for Metabase.
- Metabase app: Enables data visualization and exploration.
- pgAdmin4 app: Facilitates database administration.
It's important to note that the databases are persistent on the machine. This means that stopping and restarting the stack will preserve the data and dashboards.
One line of command suffices to spin the stack up:
docker-compose up -d
# pgAdmin: http://localhost:5050/
# Username: admin@pgadmin.com
# Password: admin
#
# Metabase: http://localhost:3000/
If you wish to setup the stack with a template table, execute this line instead:
docker-compose -f docker-compose.yaml -f dataset-sample/docker-compose.initdb.yaml up -d
# "docker-compose up -d" will work afterwards as the database has been initialised
To shut the stack down:
docker-compose down
For ARM (Apple Silicon)
Metabase currently does not offer an official ARM docker image, hence to run this stack on your Apple Silicon you have the choice between:
Through locally built Metabase ARM image (preferred)
-
Build custom Apple silicon-compatible Metabase app image locally.
make build-metabase-arm-image
-
Duplicate
.env.example
file to a.env
file. -
Append suffix
-arm
to METABASE_VERSION_TAG (e.g., v0.46.3 becomes v0.46.3-arm). -
Follow Quick start.
Through x86/amd64 emulation with Docker
-
Turn on x86/amd64 emulation with Docker (instructions), this significantly affects performance.
-
Follow Quick start.
In order to administrate and perform data exploration on our source database, pgAdmin and Metabase need to connect to it.
Source database credentials
pgAdmin | Metabase | Value to use | comment |
---|---|---|---|
Name | Display name | source-data-db | Can be changed |
Host name/address | Host | source-data-db | |
Port | Port | 5432 | |
(Not applicable) | Database name | source-data-db | |
Username | Username | user | |
Password | Password | password |
To connect to database from your machine using psql
(needs to be installed), not from the container, use following command:
psql -h localhost -p 5432 -U user -d source-data-db -W
# Type in 'password' as password