docker-compose.yml 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. # Compiles new joystream/node and joystream/apps images if local images not found
  2. # and runs a complete joystream development network
  3. # To prevent build of docker images run docker-compose with "--no-build" arg
  4. version: '3.4'
  5. services:
  6. joystream-node:
  7. image: joystream/node:latest
  8. build:
  9. # context is relative to the compose file
  10. context: .
  11. # dockerfile is relative to the context
  12. dockerfile: joystream-node.Dockerfile
  13. container_name: joystream-node
  14. volumes:
  15. - /data
  16. command: --dev --alice --validator --unsafe-ws-external --unsafe-rpc-external --rpc-methods Unsafe --rpc-cors=all --log runtime --base-path /data
  17. ports:
  18. - '127.0.0.1:9944:9944'
  19. - '127.0.0.1:9933:9933'
  20. colossus-1:
  21. image: joystream/colossus:latest
  22. container_name: colossus-1
  23. restart: on-failure
  24. build:
  25. context: .
  26. dockerfile: colossus.Dockerfile
  27. depends_on:
  28. - graphql-server
  29. volumes:
  30. - /data
  31. - /keystore
  32. ports:
  33. - '127.0.0.1:3333:3333'
  34. env_file:
  35. # relative to working directory where docker-compose was run from
  36. - .env
  37. environment:
  38. - COLOSSUS_PORT=3333
  39. - QUERY_NODE_HOST=graphql-server:${GRAPHQL_SERVER_PORT}
  40. - WORKER_ID=0
  41. - ACCOUNT_URI=//testing//worker//Storage//0
  42. # enable ElasticSearch server
  43. # - ELASTIC_SEARCH_HOST=host.docker.internal:9200
  44. distributor-1:
  45. image: joystream/distributor-node
  46. container_name: distributor-1
  47. restart: on-failure
  48. build:
  49. context: .
  50. dockerfile: distributor-node.Dockerfile
  51. depends_on:
  52. - graphql-server
  53. volumes:
  54. - /data
  55. - /cache
  56. - /logs
  57. ports:
  58. - 127.0.0.1:3334:3334
  59. # Node configuration can be overriden via env, for exampe:
  60. environment:
  61. # JOYSTREAM_DISTRIBUTOR__ID: node-id
  62. JOYSTREAM_DISTRIBUTOR__ENDPOINTS__QUERY_NODE: http://${GRAPHQL_SERVER_HOST}:${GRAPHQL_SERVER_PORT}/graphql
  63. JOYSTREAM_DISTRIBUTOR__KEYS: "[{\"suri\":\"//testing//workers//Distribution//0\"}]"
  64. JOYSTREAM_DISTRIBUTOR__WORKER_ID: 0
  65. JOYSTREAM_DISTRIBUTOR__PORT: 3334
  66. # JOYSTREAM_DISTRIBUTOR__ENDPOINTS__JOYSTREAM_NODE_WS: sn-endpoint
  67. # JOYSTREAM_DISTRIBUTOR__ENDPOINTS__ELASTIC_SEARCH: es-endpoint
  68. # JOYSTREAM_DISTRIBUTOR__DIRECTORIES__ASSETS: assets-dir
  69. # JOYSTREAM_DISTRIBUTOR__DIRECTORIES__CACHE_STATE: cache-state-dir
  70. # JOYSTREAM_DISTRIBUTOR__DIRECTORIES__LOGS: logs-dir
  71. # JOYSTREAM_DISTRIBUTOR__LOG__CONSOLE: "off"
  72. # JOYSTREAM_DISTRIBUTOR__LOG__FILE: "off"
  73. # JOYSTREAM_DISTRIBUTOR__LOG__ELASTIC: "off"
  74. # JOYSTREAM_DISTRIBUTOR__LIMITS__STORAGE: 50G
  75. # JOYSTREAM_DISTRIBUTOR__BUCKETS: "[1,2]"
  76. command: ["start"]
  77. colossus-2:
  78. image: joystream/colossus:latest
  79. container_name: colossus-2
  80. restart: on-failure
  81. build:
  82. context: .
  83. dockerfile: colossus.Dockerfile
  84. depends_on:
  85. - graphql-server
  86. volumes:
  87. - /data
  88. - /keystore
  89. ports:
  90. - '127.0.0.1:3335:3333'
  91. env_file:
  92. # relative to working directory where docker-compose was run from
  93. - .env
  94. environment:
  95. - COLOSSUS_PORT=3333
  96. - QUERY_NODE_HOST=graphql-server:${GRAPHQL_SERVER_PORT}
  97. - WORKER_ID=1
  98. - ACCOUNT_URI=//testing//worker//Storage//1
  99. # enable ElasticSearch server
  100. # - ELASTIC_SEARCH_HOST=host.docker.internal:9200
  101. distributor-2:
  102. image: joystream/distributor-node
  103. container_name: distributor-2
  104. restart: on-failure
  105. build:
  106. context: .
  107. dockerfile: distributor-node.Dockerfile
  108. depends_on:
  109. - graphql-server
  110. volumes:
  111. - /data
  112. - /cache
  113. - /logs
  114. ports:
  115. - 127.0.0.1:3336:3334
  116. # Node configuration can be overriden via env, for exampe:
  117. environment:
  118. # JOYSTREAM_DISTRIBUTOR__ID: node-id
  119. JOYSTREAM_DISTRIBUTOR__ENDPOINTS__QUERY_NODE: http://${GRAPHQL_SERVER_HOST}:${GRAPHQL_SERVER_PORT}/graphql
  120. JOYSTREAM_DISTRIBUTOR__KEYS: "[{\"suri\":\"//testing//workers//Distribution//1\"}]"
  121. JOYSTREAM_DISTRIBUTOR__WORKER_ID: 1
  122. JOYSTREAM_DISTRIBUTOR__PORT: 3334
  123. # JOYSTREAM_DISTRIBUTOR__ENDPOINTS__JOYSTREAM_NODE_WS: sn-endpoint
  124. # JOYSTREAM_DISTRIBUTOR__ENDPOINTS__ELASTIC_SEARCH: es-endpoint
  125. # JOYSTREAM_DISTRIBUTOR__DIRECTORIES__ASSETS: assets-dir
  126. # JOYSTREAM_DISTRIBUTOR__DIRECTORIES__CACHE_STATE: cache-state-dir
  127. # JOYSTREAM_DISTRIBUTOR__DIRECTORIES__LOGS: logs-dir
  128. # JOYSTREAM_DISTRIBUTOR__LOG__CONSOLE: "off"
  129. # JOYSTREAM_DISTRIBUTOR__LOG__FILE: "off"
  130. # JOYSTREAM_DISTRIBUTOR__LOG__ELASTIC: "off"
  131. # JOYSTREAM_DISTRIBUTOR__LIMITS__STORAGE: 50G
  132. # JOYSTREAM_DISTRIBUTOR__BUCKETS: "[1,2]"
  133. command: ["start"]
  134. db:
  135. image: postgres:12
  136. container_name: db
  137. restart: always
  138. ports:
  139. - '127.0.0.1:${DB_PORT}:5432'
  140. volumes:
  141. - /var/lib/postgresql/data
  142. env_file:
  143. # relative to working directory where docker-compose was run from
  144. - .env
  145. environment:
  146. POSTGRES_USER: ${DB_USER}
  147. POSTGRES_PASSWORD: ${DB_PASS}
  148. POSTGRES_DB: ${INDEXER_DB_NAME}
  149. graphql-server:
  150. image: node:14
  151. container_name: graphql-server
  152. restart: unless-stopped
  153. env_file:
  154. # relative to working directory where docker-compose was run from
  155. - .env
  156. ports:
  157. - '127.0.0.1:8081:${GRAPHQL_SERVER_PORT}'
  158. depends_on:
  159. - db
  160. volumes:
  161. - type: bind
  162. source: .
  163. target: /joystream
  164. working_dir: /joystream
  165. command: ['yarn', 'workspace', 'query-node-root', 'query-node:start:prod']
  166. processor:
  167. image: node:14
  168. container_name: processor
  169. restart: unless-stopped
  170. env_file:
  171. # relative to working directory where docker-compose was run from
  172. - .env
  173. environment:
  174. - INDEXER_ENDPOINT_URL=http://hydra-indexer-gateway:${WARTHOG_APP_PORT}/graphql
  175. - TYPEORM_HOST=${DB_HOST}
  176. - TYPEORM_DATABASE=${DB_NAME}
  177. depends_on:
  178. - hydra-indexer-gateway
  179. volumes:
  180. - type: bind
  181. source: .
  182. target: /joystream
  183. working_dir: /joystream
  184. command: ['yarn', 'workspace', 'query-node-root', 'processor:start']
  185. indexer:
  186. image: joystream/hydra-indexer:3.0.0
  187. container_name: indexer
  188. restart: unless-stopped
  189. env_file:
  190. # relative to working directory where docker-compose was run from
  191. - .env
  192. environment:
  193. - DB_NAME=${INDEXER_DB_NAME}
  194. - INDEXER_WORKERS=5
  195. - REDIS_URI=redis://redis:6379/0
  196. - TYPES_JSON=types.json
  197. depends_on:
  198. - db
  199. - redis
  200. volumes:
  201. - ./types/augment/all/defs.json:/home/hydra/packages/hydra-indexer/types.json
  202. command: >
  203. sh -c "yarn db:bootstrap && yarn start:prod"
  204. hydra-indexer-gateway:
  205. image: joystream/hydra-indexer-gateway:3.0.0
  206. container_name: hydra-indexer-gateway
  207. restart: unless-stopped
  208. env_file:
  209. # relative to working directory where docker-compose was run from
  210. - .env
  211. environment:
  212. - WARTHOG_STARTER_DB_DATABASE=${INDEXER_DB_NAME}
  213. - WARTHOG_STARTER_DB_HOST=db
  214. - WARTHOG_STARTER_DB_PASSWORD=${DB_PASS}
  215. - WARTHOG_STARTER_DB_PORT=${DB_PORT}
  216. - WARTHOG_STARTER_DB_USERNAME=${DB_USER}
  217. - WARTHOG_STARTER_REDIS_URI=redis://redis:6379/0
  218. - WARTHOG_APP_PORT=${WARTHOG_APP_PORT}
  219. - PORT=${WARTHOG_APP_PORT}
  220. - DEBUG=*
  221. ports:
  222. - '127.0.0.1:4000:${WARTHOG_APP_PORT}'
  223. depends_on:
  224. - redis
  225. - db
  226. - indexer
  227. redis:
  228. image: redis:6.0-alpine
  229. container_name: redis
  230. restart: always
  231. ports:
  232. - '127.0.0.1:6379:6379'
  233. pioneer:
  234. image: nginx
  235. container_name: pioneer
  236. volumes:
  237. - ./pioneer/packages/apps/build:/usr/share/nginx/html
  238. ports:
  239. - "127.0.0.1:3000:80"
  240. environment:
  241. - NGINX_PORT=80