version: '3.7'

services:

  db:
    image: library/postgres:9.6.24-alpine
    ports:
      - "5432:5432"
    environment:
      - "POSTGRES_DB=openfire"
      - "POSTGRES_USER=openfire"
      - "POSTGRES_PASSWORD=hunter2"
    volumes:
      - ./sql:/docker-entrypoint-initdb.d

  xmpp1:
    image: "openfire:${OPENFIRE_TAG}"
    ports:
      - "5222:5222"
      - "5269:5269"
      - "7070:7070"
      - "7443:7443"
      - "9090:9090"
    depends_on:
      - "db"
    volumes:
      - ./_data/xmpp/conf:/var/lib/openfire/conf
      - ./_data/plugins:/opt/plugins
      - ../_common/wait-for-it.sh:/wait-for-it.sh
    command: ["/wait-for-it.sh", "-s", "db:5432", "--", "/sbin/entrypoint.sh"]

  dozzle:
    image: amir20/dozzle:latest
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    ports:
      - 9999:8080
