Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] External databases support with MongoDB #132

Closed
gander opened this issue Apr 12, 2024 · 3 comments
Closed

[BUG] External databases support with MongoDB #132

gander opened this issue Apr 12, 2024 · 3 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@gander
Copy link

gander commented Apr 12, 2024

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:https://buggregator-mongo:27017'
            MONGODB_DATABASE: 'buggregator'

    buggregator-mongo:
        image: mongo:latest
        ports:
            - 27017:27017
        environment:
            MONGO_INITDB_DATABASE: buggregator
@butschster butschster self-assigned this Apr 12, 2024
@butschster butschster added the bug Something isn't working label Apr 12, 2024
@butschster butschster added this to the 1.0 milestone Apr 12, 2024
butschster added a commit that referenced this issue Apr 14, 2024
1. Updates codebase up to PHP 8.2 using rector
2. Fixes database migrations #133
3. Runs migrations on server startup, when persistence driver `database` is used #133
4. Moves Dockerfile from `docker` -> `.docker`
5. Moves installation some PHP ext from repository `Dockerfile` to `buggregator/docker` repository to reduce time for docker image build
6. Improves `docker-compose.yaml`. Adds `mongodb`, `postgres` containers for testing connection
7. Adds missed `mongodb/mongodb` package #132
@butschster
Copy link
Member

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

@gander
Copy link
Author

gander commented Apr 17, 2024

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:https://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
Copy link
Member

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

2 participants