docker-compose.yml 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. # This compose file will deploy the services, and bootup a mongo server.
  2. # Copyright IBM Corp., All Rights Reserved.
  3. #
  4. # SPDX-License-Identifier: Apache-2.0
  5. #
  6. # Local `/opt/cello/mongo` will be used for the db storage.
  7. # cello-nginx: proxy to access operator dashboard service, listen on 8080
  8. # cello-operator-dashboard: dashboard service for operators
  9. # cello-user-dashboard: user service of cello, listen on 8081
  10. # engine: engine service of cello to provide RESTful APIs, listen on 80
  11. # cello-mongo: mongo db
  12. version: '3.2'
  13. services:
  14. # nginx as front end for the services, disable now
  15. #nginx:
  16. # image: hyperledger/cello-nginx
  17. # hostname: cello-nginx
  18. # container_name: cello-nginx
  19. # restart: always
  20. # deploy:
  21. # resources:
  22. # limits:
  23. # cpus: '0.50'
  24. # memory: 2048M
  25. # reservations:
  26. # cpus: '0.10'
  27. # memory: 256M
  28. # ports:
  29. # - "80:80"
  30. # - "8080:8080"
  31. # environment:
  32. # - BACKEND=cello-operator-dashboard
  33. # - PORT=8080
  34. # - USERNAME=admin
  35. # - PASSWORD=pass
  36. # cello dashboard service for network operator
  37. operator-dashboard:
  38. image: hyperledger/cello-operator-dashboard
  39. container_name: cello-operator-dashboard
  40. hostname: cello-operator-dashboard
  41. restart: unless-stopped
  42. environment:
  43. - MONGO_URL=mongodb://cello-mongo:27017 # used by pymongo, deprecate soon
  44. - MONGO_HOST=mongo
  45. - MONGO_DB=dev
  46. - MONGODB_PORT=27017
  47. - DEBUG=$DEV # in debug mode, service will auto-restart
  48. - LOG_LEVEL=$LOG_LEVEL # what level log will be output
  49. - STATIC_FOLDER=$STATIC_FOLDER
  50. - TEMPLATE_FOLDER=$TEMPLATE_FOLDER
  51. - ENABLE_EMAIL_ACTIVE=$ENABLE_EMAIL_ACTIVE
  52. ports:
  53. - "8071:8071"
  54. volumes:
  55. # - ./src:/app
  56. - ./src/agent/docker/_compose_files:/cello
  57. - /opt/fabric:/opt/fabric
  58. - /opt/secret:/opt/secret
  59. - /etc/localtime:/etc/localtime
  60. #TODO: need to follow other images to put at dockerhub
  61. user-dashboard:
  62. image: hyperledger/cello-user-dashboard
  63. container_name: cello-user-dashboard
  64. hostname: cello-user-dashboard
  65. restart: unless-stopped
  66. links:
  67. - mongo:dashboard_mongo
  68. - dashboard_mongo
  69. - operator-dashboard
  70. ports:
  71. - "8081:8081"
  72. environment:
  73. - NODE_ENV=production
  74. - RESTFUL_SERVER=operator-dashboard:8071
  75. - DEBUG=node:*
  76. - DEV=$DEV
  77. - LOG_LEVEL=$LOG_LEVEL
  78. - ENABLE_EMAIL_ACTIVE=$ENABLE_EMAIL_ACTIVE
  79. - SMTP_SERVER=$SMTP_SERVER
  80. - SMTP_PORT=$SMTP_PORT
  81. - SMTP_AUTH_USERNAME=$SMTP_AUTH_USERNAME
  82. - SMTP_AUTH_PASSWORD=$SMTP_AUTH_PASSWORD
  83. - MONGO_HOST=dashboard_mongo
  84. - MONGO_DB=user_dashboard
  85. - FROM_EMAIL=$FROM_EMAIL
  86. - WEBROOT=$USER_DASHBOARD_WEBROOT
  87. volumes:
  88. - /opt/cellodb/baas:/opt/data
  89. - /opt/fabric:/opt/fabric
  90. - /opt/secret:/opt/secret
  91. - /etc/localtime:/etc/localtime
  92. - /opt/SSOConfig:/opt/SSOConfig
  93. # mongo database, may use others in future
  94. mongo:
  95. image: mongo:3.4.10
  96. hostname: cello-mongo
  97. container_name: cello-mongo
  98. restart: unless-stopped
  99. deploy:
  100. resources:
  101. limits:
  102. cpus: '0.50'
  103. memory: 2048M
  104. reservations:
  105. cpus: '0.10'
  106. memory: 256M
  107. ports:
  108. #- "27017:27017" # use follow line instead in production env
  109. - "27017:27017"
  110. - "27018:27018"
  111. environment:
  112. - NO_USED=0
  113. volumes:
  114. - /opt/cellodb/mongo:/data/db
  115. - /etc/localtime:/etc/localtime
  116. # TODO: we may use one mongo instance, that should be enough
  117. dashboard_mongo:
  118. image: mongo:3.4.10
  119. hostname: cello-dashboard_mongo
  120. container_name: cello-dashboard_mongo
  121. restart: unless-stopped
  122. ports:
  123. - "27019:27017"
  124. environment:
  125. - NO_USED=0
  126. volumes:
  127. - /opt/cellodb/dashboard_mongo:/data/db
  128. nfs:
  129. image: itsthenetwork/nfs-server-alpine:9
  130. restart: unless-stopped
  131. environment:
  132. - SHARED_DIRECTORY=/cello
  133. volumes:
  134. - /opt/fabric:/cello
  135. - /etc/localtime:/etc/localtime
  136. privileged: true
  137. network_mode: host