Created
December 11, 2018 16:45
-
-
Save eliashussary/379e44a99e2389bd6a8ea6a23c2d5af8 to your computer and use it in GitHub Desktop.
A docker-compose file for metabase with postgres.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3" | |
services: | |
postgres-db: | |
image: postgres | |
restart: always | |
ports: | |
- 5432:5432 | |
environment: | |
POSTGRES_PASSWORD: postgres | |
PGDATA: /var/lib/postgresql/data | |
volumes: | |
# declare your mount volume /host/dir:/container/dir | |
- /home/app/pgdata:/var/lib/postgresql/data | |
metabase-app: | |
image: metabase/metabase | |
restart: always | |
ports: | |
- 3001:3000 | |
volumes: | |
# declare your mount volume /host/dir:/container/dir | |
- /home/app/metabase-data:/metabase-data | |
environment: | |
MB_DB_TYPE: postgres | |
MB_DB_DBNAME: metabase | |
MB_DB_PORT: 5432 | |
MB_DB_USER: metabase | |
MB_DB_PASS: postgres | |
MB_DB_HOST: postgres-db | |
depends_on: | |
- postgres-db | |
links: | |
- postgres-db |
I stepped into the same problem and started a simple project using docker-compose. It's available for anyone that feels like forking and/or contributing. I also started it for personal use in a project at work, but any improvement is welcomed.
I stepped into the same problem and started a simple project using docker-compose. It's available for anyone that feels like forking and/or contributing. I also started it for personal use in a project at work, but any improvement is welcomed.
This is a great repo! Thanks. Makes Metabase production ready much easier.
version: '3'
services:
metabase:
image: metabase/metabase
ports:
- 3000:3000
environment:
MB_DB_TYPE: postgres
MB_DB_DBNAME: metabase
MB_DB_PORT: 5432
MB_DB_USER: metabase
MB_DB_PASS: metabase
MB_DB_HOST: postgres
postgres:
image: postgres:latest
environment:
POSTGRES_USER: metabase
POSTGRES_DB: metabase
POSTGRES_PASSWORD: metabase
#command: tail -f /etc/fstab
volumes:
- ./pg:/var/lib/postgresql/data
version: '3' services: metabase: image: metabase/metabase ports: - 3000:3000 environment: MB_DB_TYPE: postgres MB_DB_DBNAME: metabase MB_DB_PORT: 5432 MB_DB_USER: metabase MB_DB_PASS: metabase MB_DB_HOST: postgres postgres: image: postgres:latest environment: POSTGRES_USER: metabase POSTGRES_DB: metabase POSTGRES_PASSWORD: metabase #command: tail -f /etc/fstab volumes: - ./pg:/var/lib/postgresql/data
does it work ?
Thank you for this @mattiashem! @renolation it worked like a charm for me.
Yes it work for me as well with postgres 16.0 latest version
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@renjithpaul27
this is quite an old
docker-compose
file that i had for personal use as @oskar-fagerfjall pointed out, it attempts to fallback to an h2 database; which is a file based database.i just attempted to run this
docker-compose
and i get a bunch of errors in the metabase container log.You need to ensure that there is a database named
metabase
on that postgres instance.You can either start the postgres container first, and execute the necessary scripts. Or you can programatically do it through some additional config. - Have a look at the Initialization Scripts part of the postgres image - https://hub.docker.com/_/postgres