marquez icon indicating copy to clipboard operation
marquez copied to clipboard

Using custom port and host address for the database

Open jpatidar30 opened this issue 1 year ago • 2 comments

Issue: None of the environment variables (MARQUEZ_DB_HOST, POSTGRES_HOST, POSTGRESQL_HOST, POSTGRES_PORT) supplied to marquez seem to work for specifying the PostgreSQL host and port. Consequently, this prevents proper integration with external PostgreSQL instances.

Use Case: In our deployment setup, we rely on an external PostgreSQL database to manage our data. As such, it is imperative to configure Marquez to connect to this external database by specifying the PostgreSQL host and port via environment variables.

Expected Behavior: I expect Marquez to provide support for specifying the PostgreSQL host and port via environment variables when deployed using Docker images, allowing seamless integration with external PostgreSQL instances.

Docker Compose:

version: "3.7"
services:
  marquez_api:
    image: "marquezproject/marquez:0.46.0"
    container_name: marquez-api
    environment:
      - MARQUEZ_PORT=5000
      - MARQUEZ_ADMIN_PORT=5001
      - MARQUEZ_DB_HOST="test"
      - POSTGRES_HOST="test"
      - POSTGRESQL_HOST="test"
      - POSTGRES_PORT=5432
      - POSTGRES_DB=postgres
      - POSTGRES_USER=password
    ports:
      - "5000:5000"
      - "5001:5001"
    volumes:
      - data:/opt/marquez
    depends_on:
      - test

  marquez_web:
    image: marquezproject/marquez-web:0.46.0
    environment:
      - MARQUEZ_HOST=marquez_api
      - MARQUEZ_PORT=5000
    ports:
      - "3000:3000"
    stdin_open: true
    tty: true
    depends_on:
      - marquez_api

  test:
    image: postgres:14
    container_name: marquez-db
    ports:
      - "5432:5432"
    environment:
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=password
      - MARQUEZ_DB=marquez
      - MARQUEZ_USER=marquez
      - MARQUEZ_PASSWORD=marquez
    volumes:
      - db-conf-new:/etc/postgresql
      - db-init-new:/docker-entrypoint-initdb.d
      - db-backup-new:/var/lib/postgresql/data
    command: ["postgres", "-c", "config_file=/etc/postgresql/postgresql.conf"]
    # Enables SQL statement logging (see: https://www.postgresql.org/docs/12/runtime-config-logging.html#GUC-LOG-STATEMENT)
    # command: ["postgres", "-c", "log_statement=all"]

volumes:
  data:
  db-conf-new:
  db-init-new:
  db-backup-new:

jpatidar30 avatar Apr 08 '24 14:04 jpatidar30

Thanks for opening your first issue in the Marquez project! Please be sure to follow the issue template!

boring-cyborg[bot] avatar Apr 08 '24 14:04 boring-cyborg[bot]