version: '2'

services:
  primary:
    image: mongo
    command: mongod --replSet ${REPLSET} --smallfiles
    ports:
      - 27017
    volumes:
      - /data/db
      - /data/configdb
    restart: always
    networks:
      - mongonet

  secondary:
    image: mongo
    command: mongod --replSet ${REPLSET} --smallfiles
    ports:
      - 27017
    volumes:
      - /data/db
      - /data/configdb
    networks:
      - mongonet

  arbiter:
    image: mongo
    command: mongod --replSet ${REPLSET} --smallfiles
    ports:
      - 27017
    volumes:
      - /data/db
    networks:
      - mongonet

networks:
  mongonet:
    driver: bridge

version: '2'

services:
  primary:
    image: mongo
    command: mongod --replSet ${REPLSET} --smallfiles --oplogSize 128
    ports:
      - 27017
    volumes:
      - /data/db
      - /data/configdb
    restart: always
    networks:
      - mongonet

  secondary:
    image: mongo
    command: mongod --replSet ${REPLSET} --smallfiles --oplogSize 128
    ports:
      - 27017
    volumes:
      - /data/db
      - /data/configdb
    networks:
      - mongonet

  arbiter:
    image: mongo
    command: mongod --replSet ${REPLSET} --smallfiles --oplogSize 1
    ports:
      - 27017
    volumes:
      - /data/db
    networks:
      - mongonet

networks:
  mongonet:
    driver: bridge

Set mongodb oplog sizes for replica set
Set mongodb oplog sizes for replica set
