version: '3.7'
services:
  db:
    image: postgres:latest
    restart: unless-stopped
    environment:
      POSTGRES_DB: "passbolt"
      POSTGRES_USER: "passbolt"
      POSTGRES_PASSWORD: "P4ssb0lt"
    volumes:
      - database_volume:/var/lib/postgresql/data

  passbolt:
    image: passbolt/passbolt:latest
    #Alternatively you can use rootless:
    #image: passbolt/passbolt:latest-ce-non-root
    restart: unless-stopped
    tty: true
    depends_on:
      - db
    environment:
      APP_FULL_BASE_URL: http://localhost
      DATASOURCES_DEFAULT_HOST: "db"
      DATASOURCES_DEFAULT_DRIVER: Cake\Database\Driver\Postgres
      DATASOURCES_DEFAULT_PORT: 5432
      DATASOURCES_DEFAULT_ENCODING: 'utf8'
      DATASOURCES_DEFAULT_USERNAME: "passbolt"
      DATASOURCES_DEFAULT_PASSWORD: "P4ssb0lt"
      DATASOURCES_DEFAULT_DATABASE: "passbolt"
      EMAIL_TRANSPORT_DEFAULT_HOST: "smtp.domain.tld"
      EMAIL_TRANSPORT_DEFAULT_PORT: 587
    volumes:
      - gpg_volume:/etc/passbolt/gpg
      - jwt_volume:/etc/passbolt/jwt
      #- ./cert.pem:/etc/ssl/certs/certificate.crt:ro
      #- ./key.pem:/etc/ssl/certs/certificate.key:ro
      #- ./cert.pem:/etc/passbolt/certs/certificate.crt:ro
      #- ./key.pem:/etc/passbolt/certs/certificate.key:ro
    command: >
      bash -c "echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections;
        apt-get update; 
        apt-get install -y php-pgsql;
        /usr/bin/wait-for.sh -t 0 db:5432 -- /docker-entrypoint.sh"
    ports:
      - 80:80
      - 443:443
    #Alternatively for non-root images:
    # - 80:8080
    # - 443:4433

volumes:
  database_volume:
  gpg_volume:
  jwt_volume:

Add docker-compose file for postgresql
PB-14006: Add docker-compose file for postgresql
