Skip to content

Conversation

@rosscdh
Copy link

@rosscdh rosscdh commented Oct 9, 2020

make this great app runnable by docker

Ross Crawford-d'Heureuse added 2 commits October 9, 2020 14:42
@plantroon
Copy link

This PR is quite old, but nowadays it is possible to initialize MongoDB docker like this:

  • docker-compose.yaml:
...
  mongodb:
    image: mongo
    volumes:
    - mongo-data:/data/db
    - ./mongo-init.js:/docker-entrypoint-initdb.d/mongo-init.js:ro
...
  • mongo-init.js:
db.createUser(
        {
            user: process.env.MONGO_INITDB_ROOT_USERNAME,
            pwd: process.env.MONGO_INITDB_ROOT_PASSWORD,
            roles: [
                {
                    role: "readWrite",
                    db: process.env.MONGO_INITDB_DATABASE
                }
            ]
        }
);

The comment in env.sample and instructions in README.md should also say mongosh instead of mongo.

@oSumAtrIX
Copy link

OP is absent from GitHub. I recommend taking over the PR.

@rosscdh
Copy link
Author

rosscdh commented Jan 8, 2024 via email

@andrewperry
Copy link

This would be awesome (still!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants