docker-compose.yml 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  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:$JOYSTREAM_NODE_TAG
  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=${COLOSSUS_1_ACCOUNT_URI}
  39. command: [
  40. 'yarn', 'storage-node', 'server', '--worker=${COLOSSUS_1_WORKER_ID}', '--port=3333', '--uploads=/data',
  41. '--sync', '--syncInterval=1',
  42. '--queryNodeHost=${COLOSSUS_QUERY_NODE_HOST}',
  43. '--apiUrl=${JOYSTREAM_NODE_WS}'
  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: ${DISTRIBUTOR_QUERY_NODE_URL}
  67. JOYSTREAM_DISTRIBUTOR__KEYS: "[{\"suri\":\"${DISTRIBUTOR_1_ACCOUNT_URI}\"}]"
  68. JOYSTREAM_DISTRIBUTOR__WORKER_ID: ${DISTRIBUTOR_1_WORKER_ID}
  69. JOYSTREAM_DISTRIBUTOR__PORT: 3334
  70. JOYSTREAM_DISTRIBUTOR__ENDPOINTS__JOYSTREAM_NODE_WS: ${JOYSTREAM_NODE_WS}
  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=${COLOSSUS_2_ACCOUNT_URI}
  100. command: [
  101. 'yarn', 'storage-node', 'server', '--worker=${COLOSSUS_2_WORKER_ID}', '--port=3333', '--uploads=/data',
  102. '--sync', '--syncInterval=1',
  103. '--queryNodeHost=${COLOSSUS_QUERY_NODE_HOST}',
  104. '--apiUrl=${JOYSTREAM_NODE_WS}'
  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: ${DISTRIBUTOR_QUERY_NODE_URL}
  128. JOYSTREAM_DISTRIBUTOR__KEYS: "[{\"suri\":\"${DISTRIBUTOR_2_ACCOUNT_URI}\"}]"
  129. JOYSTREAM_DISTRIBUTOR__WORKER_ID: ${DISTRIBUTOR_2_WORKER_ID}
  130. JOYSTREAM_DISTRIBUTOR__PORT: 3334
  131. JOYSTREAM_DISTRIBUTOR__ENDPOINTS__JOYSTREAM_NODE_WS: ${JOYSTREAM_NODE_WS}
  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}:${DB_PORT}'
  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. environment:
  165. - DB_HOST=db
  166. ports:
  167. - '127.0.0.1:8081:${WARTHOG_APP_PORT}'
  168. depends_on:
  169. - db
  170. volumes:
  171. - type: bind
  172. source: .
  173. target: /joystream
  174. working_dir: /joystream
  175. command: ['yarn', 'workspace', 'query-node-root', 'query-node:start:prod']
  176. processor:
  177. image: node:14
  178. container_name: processor
  179. restart: unless-stopped
  180. env_file:
  181. # relative to working directory where docker-compose was run from
  182. - .env
  183. environment:
  184. - INDEXER_ENDPOINT_URL=${PROCESSOR_INDEXER_GATEWAY}
  185. - TYPEORM_HOST=db
  186. - TYPEORM_DATABASE=${DB_NAME}
  187. depends_on:
  188. - db
  189. volumes:
  190. - type: bind
  191. source: .
  192. target: /joystream
  193. working_dir: /joystream
  194. command: ['yarn', 'workspace', 'query-node-root', 'processor:start']
  195. indexer:
  196. image: joystream/hydra-indexer:3.0.0
  197. container_name: indexer
  198. restart: unless-stopped
  199. env_file:
  200. # relative to working directory where docker-compose was run from
  201. - .env
  202. environment:
  203. - DB_NAME=${INDEXER_DB_NAME}
  204. - INDEXER_WORKERS=5
  205. - REDIS_URI=redis://redis:6379/0
  206. - TYPES_JSON=types.json
  207. - WS_PROVIDER_ENDPOINT_URI=${JOYSTREAM_NODE_WS}
  208. - DB_HOST=db
  209. depends_on:
  210. - db
  211. - redis
  212. volumes:
  213. - ./types/augment/all/defs.json:/home/hydra/packages/hydra-indexer/types.json
  214. command: >
  215. sh -c "yarn db:bootstrap && yarn start:prod"
  216. hydra-indexer-gateway:
  217. image: joystream/hydra-indexer-gateway:3.0.0
  218. container_name: hydra-indexer-gateway
  219. restart: unless-stopped
  220. env_file:
  221. # relative to working directory where docker-compose was run from
  222. - .env
  223. environment:
  224. - WARTHOG_STARTER_DB_DATABASE=${INDEXER_DB_NAME}
  225. - WARTHOG_STARTER_DB_HOST=db
  226. - WARTHOG_STARTER_DB_PASSWORD=${DB_PASS}
  227. - WARTHOG_STARTER_DB_PORT=${DB_PORT}
  228. - WARTHOG_STARTER_DB_USERNAME=${DB_USER}
  229. - WARTHOG_STARTER_REDIS_URI=redis://redis:6379/0
  230. - WARTHOG_APP_PORT=${WARTHOG_APP_PORT}
  231. - PORT=${WARTHOG_APP_PORT}
  232. - DEBUG=*
  233. ports:
  234. - '127.0.0.1:4000:${WARTHOG_APP_PORT}'
  235. depends_on:
  236. - db
  237. - redis
  238. redis:
  239. image: redis:6.0-alpine
  240. container_name: redis
  241. restart: always
  242. ports:
  243. - '127.0.0.1:6379:6379'
  244. pioneer:
  245. image: nginx
  246. container_name: pioneer
  247. volumes:
  248. - ./pioneer/packages/apps/build:/usr/share/nginx/html
  249. ports:
  250. - "127.0.0.1:3000:80"
  251. environment:
  252. - NGINX_PORT=80