version: '2'
services:
  nanopub:
    build: .
    depends_on:
      - db
    environment:
      - NPS_MONGODB_HOST=db
    ports:
      - 8080:8080
  db:
    image: mongo

version: '2'
services:
  nanopub:
    build: .
    depends_on:
      - db
    environment:
      - NPS_MONGODB_HOST=db
    ports:
      - 8080:8080
  db:
    image: mongo
    volumes:
      - /data/nanopubs/db:/data/db

Make MongoDB data persistent for Docker compose
Make MongoDB data persistent for Docker compose
