docker-compose-dev.yml 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  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. # redis:
  37. # image: redis
  38. rabbitmq:
  39. image: rabbitmq
  40. restart: unless-stopped
  41. container_name: cello-dashboard_rabbitmq
  42. environment:
  43. - RABBITMQ_DEFAULT_USER=$RABBITMQ_DEFAULT_USER
  44. - RABBITMQ_DEFAULT_PASS=$RABBITMQ_DEFAULT_PASS
  45. - RABBITMQ_DEFAULT_VHOST=$RABBITMQ_DEFAULT_VHOST
  46. # cello dashboard service for network operator
  47. operator-dashboard:
  48. image: hyperledger/cello-operator-dashboard
  49. container_name: cello-operator-dashboard
  50. hostname: cello-operator-dashboard
  51. restart: unless-stopped
  52. links:
  53. - rabbitmq
  54. environment:
  55. - MONGO_URL=mongodb://cello-mongo:27017 # used by pymongo, deprecate soon
  56. - MONGO_HOST=mongo
  57. - MONGO_DB=dev
  58. - MONGODB_PORT=27017
  59. - DEBUG=True # in debug mode, service will auto-restart
  60. - LOG_LEVEL=$LOG_LEVEL # what level log will be output
  61. - STATIC_FOLDER=$STATIC_FOLDER
  62. - TEMPLATE_FOLDER=$TEMPLATE_FOLDER
  63. - ENABLE_EMAIL_ACTIVE=$ENABLE_EMAIL_ACTIVE
  64. - BROKER=amqp://$RABBITMQ_DEFAULT_USER:$RABBITMQ_DEFAULT_PASS@rabbitmq:5672/$RABBITMQ_DEFAULT_VHOST
  65. - BACKEND=amqp://$RABBITMQ_DEFAULT_USER:$RABBITMQ_DEFAULT_PASS@rabbitmq:5672/$RABBITMQ_DEFAULT_VHOST
  66. ports:
  67. - "8080:8080"
  68. volumes: # This should be removed in product env
  69. - $ROOT_PATH/src/agent/docker/_compose_files:/cello
  70. - $ROOT_PATH/src:/app
  71. #TODO: need to follow other images to put at dockerhub
  72. user-dashboard:
  73. image: hyperledger/cello-user-dashboard
  74. container_name: cello-user-dashboard
  75. hostname: cello-user-dashboard
  76. links:
  77. - mongo:dashboard_mongo
  78. - dashboard_mongo
  79. - operator-dashboard
  80. ports:
  81. - "8081:8081"
  82. environment:
  83. - NODE_ENV=dev
  84. - RESTFUL_SERVER=operator-dashboard:8080
  85. - DEBUG=node:*
  86. - DEV=$DEV
  87. - LOG_LEVEL=DEBUG
  88. - ENABLE_EMAIL_ACTIVE=$ENABLE_EMAIL_ACTIVE
  89. - SMTP_SERVER=$SMTP_SERVER
  90. - SMTP_PORT=$SMTP_PORT
  91. - SMTP_AUTH_USERNAME=$SMTP_AUTH_USERNAME
  92. - SMTP_AUTH_PASSWORD=$SMTP_AUTH_PASSWORD
  93. - MONGO_HOST=dashboard_mongo
  94. - MONGO_DB=user_dashboard
  95. - FROM_EMAIL=$FROM_EMAIL
  96. - WEBROOT=$USER_DASHBOARD_WEBROOT
  97. - FABRIC_CFG_PATH=/etc/hyperledger/fabric
  98. volumes:
  99. - $ROOT_PATH/user-dashboard/src:/var/www
  100. - /opt/cello/baas:/opt/data
  101. # cello engine service
  102. engine:
  103. image: hyperledger/cello-engine
  104. container_name: cello-engine
  105. hostname: cello-engine
  106. restart: unless-stopped
  107. environment:
  108. - MONGO_URL=mongodb://cello-mongo:27017 # used by pymongo, deprecate soon
  109. - MONGO_HOST=mongo
  110. - MONGO_DB=dev
  111. - MONGODB_PORT=27017
  112. - DEBUG=$DEV # in debug mode, service will auto-restart
  113. - LOG_LEVEL=$LOG_LEVEL # what level log will be output
  114. ports:
  115. - "80:80"
  116. volumes:
  117. - $ROOT_PATH/src:/app
  118. # cello watchdog service
  119. watchdog:
  120. image: hyperledger/cello-watchdog
  121. container_name: cello-watchdog
  122. hostname: cello-watchdog
  123. restart: unless-stopped
  124. environment:
  125. - MONGO_URL=mongodb://mongo:27017 # used by pymongo, deprecate soon
  126. - MONGO_HOST=mongo
  127. - MONGO_DB=dev
  128. - MONGODB_PORT=27017
  129. - DEBUG=$DEV # in debug mode, service will auto-restart
  130. - LOG_LEVEL=$LOG_LEVEL # what level log will be output
  131. volumes: # This should be removed in product env
  132. - $ROOT_PATH/src:/app
  133. # mongo database, may use others in future
  134. mongo:
  135. image: mongo:3.4.10
  136. hostname: cello-mongo
  137. container_name: cello-mongo
  138. restart: unless-stopped
  139. deploy:
  140. resources:
  141. limits:
  142. cpus: '0.50'
  143. memory: 2048M
  144. reservations:
  145. cpus: '0.10'
  146. memory: 256M
  147. ports:
  148. #- "27017:27017" # use follow line instead in production env
  149. - "127.0.0.1:27017:27017"
  150. - "127.0.0.1:27018:27018"
  151. environment:
  152. - NO_USED=0
  153. volumes:
  154. - /opt/cello/mongo:/data/db
  155. # TODO: we may use one mongo instance, that should be enough
  156. dashboard_mongo:
  157. image: mongo:3.4.10
  158. hostname: cello-dashboard_mongo
  159. container_name: cello-dashboard_mongo
  160. restart: unless-stopped
  161. environment:
  162. - NO_USED=0
  163. volumes:
  164. - /opt/cello/dashboard_mongo:/data/db