buggregator / server

Buggregator is a lightweight, standalone server that offers a range of debugging features for PHP applications.
https://buggregator.dev/
Other
648 stars 23 forks source link

[BUG] External databases support with MongoDB #132

Closed gander closed 4 months ago

gander commented 4 months ago
buggregator-1  | [INFO] RoadRunner server started; version: 2023.3.7, buildtime: 2023-11-30T19:15:58+0000
buggregator-1  | [INFO] sdnotify: not notified
buggregator-1  | 2024-04-12T08:29:03+0000       ERROR   app             Error: Class "MongoDB\Client" not found in /app/app/src/Application/Bootloader/MongoDBBootloader.php at line 18 [] []
buggregator-1  | 
buggregator-1  | 2024-04-12T08:29:03+0000       ERROR   app             Error: Class "MongoDB\Client" not found in /app/app/src/Application/Bootloader/MongoDBBootloader.php at line 18 [] []
buggregator-1  | 
buggregator-1  | 2024-04-12T08:29:03+0000       ERROR   app             Error: Class "MongoDB\Client" not found in /app/app/src/Application/Bootloader/MongoDBBootloader.php at line 18 [] []
buggregator-1  | 
buggregator-1  | 2024-04-12T08:29:03+0000       ERROR   app             Error: Class "MongoDB\Client" not found in /app/app/src/Application/Bootloader/MongoDBBootloader.php at line 18 [] []
services:
    buggregator:
        image: ghcr.io/buggregator/server:latest
        ports:
            - 127.0.0.1:8000:8000
        environment:
            PERSISTENCE_DRIVER: 'mongodb'
            MONGODB_CONNECTION: 'mongodb://buggregator-mongo:27017'
            MONGODB_DATABASE: 'buggregator'

    buggregator-mongo:
        image: mongo:latest
        ports:
            - 27017:27017
        environment:
            MONGO_INITDB_DATABASE: buggregator
butschster commented 4 months ago

This should be done by latest release. Could you check please? :)

gander commented 4 months ago

This works:

services:
    buggregator:
        image: ghcr.io/buggregator/server:latest
        depends_on:
            buggregator-database:
                condition: service_healthy
        ports:
            - 127.0.0.1:8000:8000
        environment:
            PERSISTENCE_DRIVER: 'mongodb'
            MONGODB_CONNECTION: 'mongodb://buggregator-database:27017'
            MONGODB_DATABASE: 'buggregator'

    buggregator-database:
        image: mongo:latest
        healthcheck:
            test: [ "CMD-SHELL", "mongosh --eval 'db.runCommand({ping: 1}).ok' || exit 1" ]
            interval: 3s
            timeout: 3s
            retries: 1
butschster commented 4 months ago

Thank you!