Yml file format for postgres db

Hi,
Can anyone provide me how to configure external postgres Database connection URL in docker.
and share your yml file format for that.

Thanking you

Is this what you’re looking for? Or do you want it to connect to an existing postgres database that you have?

version: '3'

volumes:
  postgres_data:
    driver: local

services:
  postgres:
    image: postgres:11
    volumes:
      - postgres_data:/var/lib/postgresql/data
    environment:
      POSTGRES_DB: keycloak
      POSTGRES_USER: keycloak
      POSTGRES_PASSWORD: password
    ports:
      - 5433:5432
  keycloak:
    image:jboss/keycloak:latest
    environment:
      DB_VENDOR: POSTGRES
      DB_ADDR: postgres
      DB_DATABASE: keycloak
      DB_USER: keycloak
      DB_SCHEMA: public
      DB_PASSWORD: password
      KEYCLOAK_USER: admin
      KEYCLOAK_PASSWORD: password
      KEYCLOAK_LOGLEVEL: DEBUG
      ROOT_LOGLEVEL: DEBUG
    ports:
      - 8080:8080
      - 8443:8443
    depends_on:
      - postgres

No sir this is not what i am looking for.
this is for postgres image.
Actually we are using external postgres db.
we have to connect that external postgres db to keycloak.
Please provide me yml file. how we can integrate external postgres db in keycloak using yml file

For an external database, you use DB_ADDR and DB_PORT params. Full documentation on the parameters is here: Docker Hub


above mention is my docker-compose.yml file.
can you please tell me exactly what changes needed to refer to external DB url instead of postgres image

Thanking You

@xgp

Can you suggest the change needed to refer the postgres Connetcion URL
instead of postgres image.
I tried removing the Postgres and depends_on section from services and passed the Database connection details in Kecyloak environment section in yaml but it did not worked for me.