docker-compose.yml 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  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: node:14
  22. container_name: colossus-1
  23. restart: on-failure
  24. volumes:
  25. - /data
  26. - /keystore
  27. - type: bind
  28. source: .
  29. target: /joystream
  30. working_dir: /joystream/storage-node-v2
  31. ports:
  32. - '127.0.0.1:3333:3333'
  33. env_file:
  34. # relative to working directory where docker-compose was run from
  35. - .env
  36. environment:
  37. # ACCOUNT_URI overrides command line arg --accountUri
  38. - ACCOUNT_URI=//testing//worker//Storage//0
  39. command: [
  40. 'yarn', 'storage-node', 'server', '--worker=0', '--port=3333', '--uploads=/data',
  41. '--sync', '--syncInterval=1',
  42. '--queryNodeHost=graphql-server:${WARTHOG_APP_PORT}',
  43. '--apiUrl=ws://joystream-node:9944/'
  44. ]
  45. distributor-1:
  46. image: node:14
  47. container_name: distributor-1
  48. restart: on-failure
  49. volumes:
  50. - /data
  51. - /cache
  52. - /logs
  53. - type: bind
  54. source: .
  55. target: /joystream
  56. # let the working_dir be the distributor node to pickup the config.yml file
  57. working_dir: /joystream/distributor-node
  58. ports:
  59. - 127.0.0.1:3334:3334
  60. env_file:
  61. # relative to working directory where docker-compose was run from
  62. - .env
  63. # Node configuration can be overriden via env, for exampe:
  64. environment:
  65. JOYSTREAM_DISTRIBUTOR__ID: distributor-1
  66. JOYSTREAM_DISTRIBUTOR__ENDPOINTS__QUERY_NODE: http://graphql-server:${WARTHOG_APP_PORT}/graphql
  67. JOYSTREAM_DISTRIBUTOR__KEYS: "[{\"suri\":\"//testing//workers//Distribution//0\"}]"
  68. JOYSTREAM_DISTRIBUTOR__WORKER_ID: 0
  69. JOYSTREAM_DISTRIBUTOR__PORT: 3334
  70. JOYSTREAM_DISTRIBUTOR__ENDPOINTS__JOYSTREAM_NODE_WS: ws://joystream-node:9944/
  71. # JOYSTREAM_DISTRIBUTOR__ENDPOINTS__ELASTIC_SEARCH: es-endpoint
  72. # JOYSTREAM_DISTRIBUTOR__DIRECTORIES__ASSETS: assets-dir
  73. # JOYSTREAM_DISTRIBUTOR__DIRECTORIES__CACHE_STATE: cache-state-dir
  74. # JOYSTREAM_DISTRIBUTOR__DIRECTORIES__LOGS: logs-dir
  75. # JOYSTREAM_DISTRIBUTOR__LOG__CONSOLE: "off"
  76. # JOYSTREAM_DISTRIBUTOR__LOG__FILE: "off"
  77. # JOYSTREAM_DISTRIBUTOR__LOG__ELASTIC: "off"
  78. # JOYSTREAM_DISTRIBUTOR__LIMITS__STORAGE: 50G
  79. # JOYSTREAM_DISTRIBUTOR__BUCKETS: "[1,2]"
  80. command: ['yarn', 'joystream-distributor', 'start']
  81. colossus-2:
  82. image: node:14
  83. container_name: colossus-2
  84. restart: on-failure
  85. volumes:
  86. - /data
  87. - /keystore
  88. - type: bind
  89. source: .
  90. target: /joystream
  91. working_dir: /joystream/storage-node-v2
  92. ports:
  93. - '127.0.0.1:3335:3333'
  94. env_file:
  95. # relative to working directory where docker-compose was run from
  96. - .env
  97. environment:
  98. # ACCOUNT_URI overrides command line arg --accountUri
  99. - ACCOUNT_URI=//testing//worker//Storage//1
  100. command: [
  101. 'yarn', 'storage-node', 'server', '--worker=1', '--port=3333', '--uploads=/data',
  102. '--sync', '--syncInterval=1',
  103. '--queryNodeHost=graphql-server:${WARTHOG_APP_PORT}',
  104. '--apiUrl=ws://joystream-node:9944/'
  105. ]
  106. distributor-2:
  107. image: node:14
  108. container_name: distributor-2
  109. restart: on-failure
  110. volumes:
  111. - /data
  112. - /cache
  113. - /logs
  114. - type: bind
  115. source: .
  116. target: /joystream
  117. # let the working_dir be the distributor node to pickup the config.yml file
  118. working_dir: /joystream/distributor-node
  119. ports:
  120. - 127.0.0.1:3336:3334
  121. env_file:
  122. # relative to working directory where docker-compose was run from
  123. - .env
  124. # Node configuration can be overriden via env, for exampe:
  125. environment:
  126. JOYSTREAM_DISTRIBUTOR__ID: distributor-2
  127. JOYSTREAM_DISTRIBUTOR__ENDPOINTS__QUERY_NODE: http://graphql-server:${WARTHOG_APP_PORT}/graphql
  128. JOYSTREAM_DISTRIBUTOR__KEYS: "[{\"suri\":\"//testing//workers//Distribution//1\"}]"
  129. JOYSTREAM_DISTRIBUTOR__WORKER_ID: 1
  130. JOYSTREAM_DISTRIBUTOR__PORT: 3334
  131. JOYSTREAM_DISTRIBUTOR__ENDPOINTS__JOYSTREAM_NODE_WS: ws://joystream-node:9944/
  132. # JOYSTREAM_DISTRIBUTOR__ENDPOINTS__ELASTIC_SEARCH: es-endpoint
  133. # JOYSTREAM_DISTRIBUTOR__DIRECTORIES__ASSETS: assets-dir
  134. # JOYSTREAM_DISTRIBUTOR__DIRECTORIES__CACHE_STATE: cache-state-dir
  135. # JOYSTREAM_DISTRIBUTOR__DIRECTORIES__LOGS: logs-dir
  136. # JOYSTREAM_DISTRIBUTOR__LOG__CONSOLE: "off"
  137. # JOYSTREAM_DISTRIBUTOR__LOG__FILE: "off"
  138. # JOYSTREAM_DISTRIBUTOR__LOG__ELASTIC: "off"
  139. # JOYSTREAM_DISTRIBUTOR__LIMITS__STORAGE: 50G
  140. # JOYSTREAM_DISTRIBUTOR__BUCKETS: "[1,2]"
  141. command: ['yarn', 'joystream-distributor', 'start']
  142. db:
  143. image: postgres:12
  144. container_name: db
  145. restart: always
  146. ports:
  147. - '127.0.0.1:${DB_PORT}:5432'
  148. volumes:
  149. - /var/lib/postgresql/data
  150. env_file:
  151. # relative to working directory where docker-compose was run from
  152. - .env
  153. environment:
  154. POSTGRES_USER: ${DB_USER}
  155. POSTGRES_PASSWORD: ${DB_PASS}
  156. POSTGRES_DB: ${INDEXER_DB_NAME}
  157. graphql-server:
  158. image: node:14
  159. container_name: graphql-server
  160. restart: unless-stopped
  161. env_file:
  162. # relative to working directory where docker-compose was run from
  163. - .env
  164. ports:
  165. - '127.0.0.1:8081:${WARTHOG_APP_PORT}'
  166. depends_on:
  167. - db
  168. volumes:
  169. - type: bind
  170. source: .
  171. target: /joystream
  172. working_dir: /joystream
  173. command: ['yarn', 'workspace', 'query-node-root', 'query-node:start:prod']
  174. processor:
  175. image: node:14
  176. container_name: processor
  177. restart: unless-stopped
  178. env_file:
  179. # relative to working directory where docker-compose was run from
  180. - .env
  181. environment:
  182. - INDEXER_ENDPOINT_URL=http://hydra-indexer-gateway:${WARTHOG_APP_PORT}/graphql
  183. - TYPEORM_HOST=${DB_HOST}
  184. - TYPEORM_DATABASE=${DB_NAME}
  185. depends_on:
  186. - hydra-indexer-gateway
  187. volumes:
  188. - type: bind
  189. source: .
  190. target: /joystream
  191. working_dir: /joystream
  192. command: ['yarn', 'workspace', 'query-node-root', 'processor:start']
  193. indexer:
  194. image: joystream/hydra-indexer:3.0.0
  195. container_name: indexer
  196. restart: unless-stopped
  197. env_file:
  198. # relative to working directory where docker-compose was run from
  199. - .env
  200. environment:
  201. - DB_NAME=${INDEXER_DB_NAME}
  202. - INDEXER_WORKERS=5
  203. - REDIS_URI=redis://redis:6379/0
  204. - TYPES_JSON=types.json
  205. - WS_PROVIDER_ENDPOINT_URI=${INDEXER_WS_PROVIDER_ENDPOINT_URI}
  206. depends_on:
  207. - db
  208. - redis
  209. volumes:
  210. - ./types/augment/all/defs.json:/home/hydra/packages/hydra-indexer/types.json
  211. command: >
  212. sh -c "yarn db:bootstrap && yarn start:prod"
  213. hydra-indexer-gateway:
  214. image: joystream/hydra-indexer-gateway:3.0.0
  215. container_name: hydra-indexer-gateway
  216. restart: unless-stopped
  217. env_file:
  218. # relative to working directory where docker-compose was run from
  219. - .env
  220. environment:
  221. - WARTHOG_STARTER_DB_DATABASE=${INDEXER_DB_NAME}
  222. - WARTHOG_STARTER_DB_HOST=${DB_HOST}
  223. - WARTHOG_STARTER_DB_PASSWORD=${DB_PASS}
  224. - WARTHOG_STARTER_DB_PORT=${DB_PORT}
  225. - WARTHOG_STARTER_DB_USERNAME=${DB_USER}
  226. - WARTHOG_STARTER_REDIS_URI=redis://redis:6379/0
  227. - WARTHOG_APP_PORT=${WARTHOG_APP_PORT}
  228. - PORT=${WARTHOG_APP_PORT}
  229. - DEBUG=*
  230. ports:
  231. - '127.0.0.1:4000:${WARTHOG_APP_PORT}'
  232. depends_on:
  233. - redis
  234. - db
  235. - indexer
  236. redis:
  237. image: redis:6.0-alpine
  238. container_name: redis
  239. restart: always
  240. ports:
  241. - '127.0.0.1:6379:6379'
  242. pioneer:
  243. image: nginx
  244. container_name: pioneer
  245. volumes:
  246. - ./pioneer/packages/apps/build:/usr/share/nginx/html
  247. ports:
  248. - "127.0.0.1:3000:80"
  249. environment:
  250. - NGINX_PORT=80