version: "2"
services:
  test:
    build: .
    command: bash -c "sleep 20 && npm test"
    depends_on:
      - db
    environment:
      - DEBUG=
      - MONGODB_URL=mongodb://db:27017/test
      - OPLOG_MONGODB_URL=mongodb://db:27017/local
  db:
    image: mongo:3.4.0
    command: mongod --replSet rs0 --oplogSize 20 --smallfiles --nojournal
  initReplicaset:
    image: mongo:3.4.0
    command: bash -c "sleep 10 && mongo admin --host db:27017 --eval 'printjson(rs.initiate());'"
