enh: update README with new Docker instructions

parent 94832729
...@@ -33,16 +33,19 @@ run mongodb://myuser:mypassword@myhost:myport/mydb?mycollection ...@@ -33,16 +33,19 @@ run mongodb://myuser:mypassword@myhost:myport/mydb?mycollection
You need to have a MongoDB running with the corresponding user declared in the *admin* database (by convention). You need to have a MongoDB running with the corresponding user declared in the *admin* database (by convention).
To run a mongoDB using docker (you need to forward the port): To run a mongoDB using docker (you need to forward the port):
```jshelllanguage ```jshelllanguage
docker pull mongo cd docker
docker run --name some-mongo -p 27017:27017 -d mongo docker build -t openmole/mongo-gate .
``` mkdir -p data/{configdb,db}
Then, create the user (openmole by defaut): docker run \
```jshelllanguage -v $(pwd)/data/db:/data/db \
mongo -v $(pwd)/data/configdb:/data/configdb \
use admin --name openmole-gate-dummy \
db.createUser({ user: 'openmole', pwd: 'rocks', roles: ["readWrite" ] }) -p 27017:27017 \
use openmole --restart=always \
db.test.save({a:"b"}) -e MONGO_INITDB_DATABASE=openmole \
-d openmole/mongo-gate:latest
``` ```
This will start a MongoDB instance prepopulated with an `openmole` user and a dummy record in a `test` collection.
Then, browse [localhost:8080](localhost:8080) Then, browse [localhost:8080](localhost:8080)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment