Simple solution using Node.js, MongoDB and Docker
# Run in Docker
docker-compose up
# use -d flag to run in background
# Tear down
docker-compose down
# To re-build
docker-compose build
# To test the solution
access on browser the urls http://localhost:3000/machines for the machines endpoint
and http://localhost:3000/events for the events endpoint