Docker Compose for Metabase
Metabase business intelligence with PostgreSQL. Ask questions about your data.
metabase analytics bi postgres
compose.yaml
services:
metabase:
image: metabase/metabase:latest
ports:
- target: 3000
mode: ingress
environment:
- MB_DB_TYPE=postgres
- MB_DB_HOST=db
- MB_DB_PORT=5432
- MB_DB_DBNAME=metabase
- MB_DB_USER=postgres
- MB_DB_PASS=${MB_DB_PASS}
healthcheck:
test:
- CMD
- curl
- -f
- http://localhost:3000/api/health
interval: 30s
timeout: 10s
retries: 5
depends_on:
- db
deploy:
resources:
reservations:
cpus: "1"
memory: 1G
restart: unless-stopped
db:
image: postgres:16
ports:
- target: 5432
mode: host
environment:
- POSTGRES_DB=metabase
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
healthcheck:
test:
- CMD-SHELL
- pg_isready -U postgres
interval: 10s
timeout: 5s
retries: 5
deploy:
resources:
reservations:
cpus: "0.5"
memory: 256M
restart: unless-stopped
x-defang-postgres: true
Services
- metabase metabase/metabase:latest
- db postgres:16