services:
  db:
    image: mariadb:10.11
    restart: unless-stopped
    environment:
      MYSQL_RANDOM_ROOT_PASSWORD: "true"
      MYSQL_DATABASE: "passbolt"
      MYSQL_USER: "passbolt_user"
      MYSQL_PASSWORD: "M5a2ex27L8rPbV"
    volumes:
      - database_volume:/var/lib/mysql

  passbolt:
    image: passbolt/passbolt:latest-ce
    #Alternatively you can use rootless:
    #image: passbolt/passbolt:latest-ce-non-root
    restart: unless-stopped
    depends_on:
      - db
    environment:
      APP_FULL_BASE_URL: https://safe.intranet-netbyus.com
      EMAIL_DEFAULT_FROM_NAME: "Support NBU"
      EMAIL_DEFAULT_FROM: "support@netbyus.com"
      EMAIL_TRANSPORT_DEFAULT_HOST: "mailpar.centrech.fr"
      EMAIL_TRANSPORT_DEFAULT_PORT: 25
      EMAIL_TRANSPORT_DEFAULT_USERNAME: "smtp@netbyus.com"
      EMAIL_TRANSPORT_DEFAULT_PASSWORD: "xNysE@xpE"
      EMAIL_TRANSPORT_DEFAULT_TLS: null
      DATASOURCES_DEFAULT_HOST: "db"
      DATASOURCES_DEFAULT_USERNAME: "passbolt_user"
      DATASOURCES_DEFAULT_PASSWORD: "M5a2ex27L8rPbV"
      DATASOURCES_DEFAULT_DATABASE: "passbolt"
    volumes:
      - gpg_volume:/etc/passbolt/gpg
      - jwt_volume:/etc/passbolt/jwt
    command:
      [
        "/usr/bin/wait-for.sh",
        "-t",
        "0",
        "db:3306",
        "--",
        "/docker-entrypoint.sh",
      ]
    ports:
      - 8090:80
      - 8043:443
    #Alternatively for non-root images:
    # - 80:8080
    # - 443:4433

volumes:
  database_volume:
  gpg_volume:
  jwt_volume:
