services:
  metabase-db:
    image: postgres:15
    container_name: metabase-db
    environment:
      - POSTGRES_USER=metabase
      - POSTGRES_PASSWORD=metabase
      - POSTGRES_DB=metabase
    volumes:
      - metabase-data:/var/lib/postgresql/data
    restart: unless-stopped

  metabase:
    image: metabase/metabase:latest
    container_name: metabase
    ports:
      - "3200: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=metabase-db
    depends_on:
      - metabase-db
    restart: unless-stopped

  rill:
    image: rilldata/rill:latest
    container_name: rill
    ports:
      - "9009:9009"
    volumes:
      - ./rill-data:/rill
    working_dir: /rill
    environment:
      - RILL_ADMIN_URL=http://localhost:9009
    command: start
    restart: unless-stopped

volumes:
  metabase-data:
