enh: update README with new Docker instructions

parent 94832729
......@@ -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).
To run a mongoDB using docker (you need to forward the port):
```jshelllanguage
docker pull mongo
docker run --name some-mongo -p 27017:27017 -d mongo
```
Then, create the user (openmole by defaut):
```jshelllanguage
mongo
use admin
db.createUser({ user: 'openmole', pwd: 'rocks', roles: ["readWrite" ] })
use openmole
db.test.save({a:"b"})
cd docker
docker build -t openmole/mongo-gate .
mkdir -p data/{configdb,db}
docker run \
-v $(pwd)/data/db:/data/db \
-v $(pwd)/data/configdb:/data/configdb \
--name openmole-gate-dummy \
-p 27017:27017 \
--restart=always \
-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)
\ 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