version: '2'
services:
  db:
    image: postgres
    environment:
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=postgres
    expose:
      - 5432/tcp
  opennms:
    image: indigo/docker-opennms
    depends_on:
      - db
    links:
      - db:database
    environment:
      - POSTGRES_HOST=database
      - POSTGRES_PORT=5432
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=postgres
      - OPENNMS_DBNAME=opennms
      - OPENNMS_DBUSER=opennms
      - OPENNMS_DBPASS=opennms
      - OPENNMS_HOME=/opt/opennms
      - OPENNMS_DB_CONFIG=/opt/opennms/etc/opennms-datasources.xml
    command: ["-f"]
    expose:
      - 8980/tcp
      - 18980/tcp
      - 1099/tcp
      - 8101/tcp
      - 61616/tcp
      - 5817/tcp
      - 162/udp

version: '2'
services:
  database:
    image: postgres
    environment:
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=postgres
    expose:
      - 5432/tcp
  opennms:
    image: indigo/docker-opennms
    depends_on:
      - db
    links:
      - db:database
    environment:
      - POSTGRES_HOST=database
      - POSTGRES_PORT=5432
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=postgres
      - OPENNMS_DBNAME=opennms
      - OPENNMS_DBUSER=opennms
      - OPENNMS_DBPASS=opennms
      - OPENNMS_HOME=/opt/opennms
      - OPENNMS_DB_CONFIG=/opt/opennms/etc/opennms-datasources.xml
    command: ["-f"]
    expose:
      - 8980/tcp
      - 18980/tcp
      - 1099/tcp
      - 8101/tcp
      - 61616/tcp
      - 5817/tcp
      - 162/udp

Set postgres host, port and opennms database name to allow usage of user defined networks
Set postgres host, port and opennms database name to allow usage of user defined networks
