You should have installed:
- Docker
- Docker Compose
- MongoDB Database Tools (specifically
mongoimport
to add the dummy data to the database) - Python 3
All of the commands should be executed from the deploy directory.
cd deploy
docker-compose up -d db
docker-compose up -d mongo-express
With mongo-express
we can see the contents of the database at http://localhost:8081.
To load the database we execute the following commands:
mongoimport --jsonArray --uri "mongodb://vpbib:[email protected]:27017/beacon?authSource=admin" --file data/datasets*.json --collection datasets
mongoimport --jsonArray --uri "mongodb://vpbib:[email protected]:27017/beacon?authSource=admin" --file data/individuals*.json --collection individuals
This loads the JSON files inside of the data
folder into the MongoDB database.
You can also use
make load
as a convenience alias.
You can create the necessary indexes running the following Python script:
# Install the dependencies
pip3 install pymongo
python3 reindex.py
Once the database is setup, you can up the beacon with the following command:
docker-compose up -d beacon
Check the logs until the beacon is ready to be queried:
docker-compose logs -f beacon