Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/Tinitto/compose-postgres-metabase

A metabase application that runs on postgreSQL and docker compose
https://github.com/Tinitto/compose-postgres-metabase

Last synced: about 2 months ago
JSON representation

A metabase application that runs on postgreSQL and docker compose

Awesome Lists containing this project

README

        

# Dockerized Metabase with PostgreSQL backend

> Then Jesus went about all cities and villages, teaching in their synagogues, preaching the gospel of the kingdom, healing every sickness and every disease among the people.
>
> But when He saw the multitudes, He was moved with compassion for them, because they were weary and scattered, like sheep having no shepherd.
>
> -- [Matthew 9: 35-36](https://www.bible.com/en-GB/bible/114/MAT.9.NKJV)

[Metabase](https://www.metabase.com/) is an open-source java-based software that enables users to analyse data from a range of data sources including relational databases (e.g. Postgresql, MySQL etc.), NoSql databases etc.

It can be quite helpful when one has a data science question that could easily be answered by data analysis.

By default, it stores application-specific data e.g. users, stored queries, configurations etc. on an H2 database on the same file system where it is installed.

However, it is difficult to retrieve this data once the application crushes (which it might do if you write a wrong sql query for it to run on your data). It is therefore usually better to have the application save the data in a postgreSQL database such that it recovers its original state after any crush.

## Technology used

| Technology | Usage |
| --- | --- |
|[Docker](https://docs.docker.com/) | metabase and postgres run in different Docker containers|
|[Docker Compose](https://docs.docker.com/compose/) | Docker compose netwroks the different Docker containers to allow them work together as dependent services |
|[Metabase](https://www.metabase.com/)| SQL based Analysis and Visualization program for any database |
| [Postgres](https://www.postgresql.org/) | A database engine that stores relational data in a persistent way |

## How to run

This assumes the local machine is running on Ubuntu

1. Ensure docker is installed. If it is not installed, install it. Here are [the instructions](https://docs.docker.com/install/linux/docker-ce/ubuntu/).
2. Ensure docker compose is installed on your system. If it is not installed, install it. Here are [the instructions](https://docs.docker.com/compose/install/).
3. Clone this git repository

```bash
git clone https://github.com/Tinitto/compose-postgres-metabase.git
```

4. Enter the compose-postgres-metabase folder

```bash
cd compose-postgres-metabase
```

5. Convert `config/metabase_database.env.example` to `config/metabase_database.env`.
6. Update the environment variables `MB_DB_PASS`, `MB_ENCRYPTION_SECRET_KEY` and save.

```bash
MB_DB_PASS=
MB_ENCRYPTION_SECRET_KEY=
```

7. Convert `config/postgres.env.example` to `config/postgres.env`.
8. Update the environment variables `POSTGRES_PASSWORD`, `METABASE_PASSWORD` and save.

```bash
POSTGRES_PASSWORD=
METABASE_PASSWORD=
```

9. Start the docker compose services

```bash
sudo docker-compose up -d
```

10. Set up your metabase instance by visiting the [local metabase start URL](http://localhost:3000)
If you are on a server, use `http://:3000`.

## Service - Port Mappings

| Service | Port |
| -------- | ----- |
| Metabase | 3000 |
| Postgres | 54320 |

## Contributions

Contributions are welcome.

Please first take a look at the [CONTRIBUTIONS GUIDELINES](./CONTRIBUTING.md).

## License

Copyright (c) 2019 [Martin Ahindura](https://github.com/Tinitto)

Licensed under the [MIT License](./LICENSE)

## Acknowledgement

Some of the configuration was learnt from the [Beyond Jupyter](https://github.com/jgoerner/beyond-jupyter) talk by [Joshua Gorner](https://github.com/jgoerner)

Buy Me A Coffee