Advertisement
Guest User

Untitled

a guest
Jul 16th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. version: '3'
  2. services:
  3. mongo1:
  4. hostname: mongo1
  5. container_name: localmongo1
  6. image: mongo
  7. expose:
  8. - 27017
  9. ports:
  10. - 27017:27017
  11. restart: always
  12. entrypoint: ["/usr/bin/mongod", "--bind_ip_all", "--replSet", "rs0"]
  13. # volumes:
  14. # - /data/db/mongotest:/data/db # This is where your volume will persist. e.g. VOLUME-DIR = ./volumes/mongodb
  15.  
  16. mongo2:
  17. hostname: mongo2
  18. container_name: localmongo2
  19. image: mongo
  20. expose:
  21. - 27017
  22. ports:
  23. - 27018:27017
  24. restart: always
  25. entrypoint: ["/usr/bin/mongod", "--bind_ip_all", "--replSet", "rs0"]
  26.  
  27. mongo3:
  28. hostname: mongo3
  29. container_name: localmongo3
  30. image: mongo
  31. expose:
  32. - 27017
  33. ports:
  34. - 27019:27017
  35. restart: always
  36. entrypoint: ["/usr/bin/mongod", "--bind_ip_all", "--replSet", "rs0"]
  37.  
  38. rsinit:
  39. build:
  40. context: .
  41. dockerfile: rsinit
  42. depends_on:
  43. - mongo1
  44. - mongo2
  45. - mongo3
  46. entrypoint: ["sh", "-c", "rs.sh"]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement