Skip to content

Lightweight Dockerized Data Exploration Stack with PostgreSQL, Metabase, and pgAdmin4

License

Notifications You must be signed in to change notification settings

tucared/data-exploration-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

data-exploration-docker

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.

Quick start

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)

  1. Build custom Apple silicon-compatible Metabase app image locally.

    make build-metabase-arm-image
  2. Duplicate .env.example file to a .env file.

  3. Append suffix -arm to METABASE_VERSION_TAG (e.g., v0.46.3 becomes v0.46.3-arm).

  4. Follow Quick start.

Through x86/amd64 emulation with Docker

  1. Turn on x86/amd64 emulation with Docker (instructions), this significantly affects performance.

  2. Follow Quick start.

Connecting to source database

Using pgAdmin and Metabase

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

Using psql CLI

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

About

Lightweight Dockerized Data Exploration Stack with PostgreSQL, Metabase, and pgAdmin4

Topics

Resources

License

Stars

Watchers

Forks