version: '3.7'

services:
  db:
    image: library/postgres:9.6.17-alpine
    ports:
      - "5432:5432"
    environment:
      - POSTGRES_DB=openfire
      - POSTGRES_USER=${CONNECTION_USERNAME}
      - POSTGRES_PASSWORD=${CONNECTION_PASSWORD}
    healthcheck:
      test: [ "CMD-SHELL", "pg_isready --host=127.0.0.1 --dbname=openfire" ]
      interval: 5s
      timeout: 5s
      retries: 30
    volumes:
      - ${GITHUB_WORKSPACE}/olddb:/docker-entrypoint-initdb.d
