docker-compose.yml 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  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:
  21. image: joystream/colossus:latest
  22. restart: on-failure
  23. build:
  24. context: .
  25. dockerfile: colossus.Dockerfile
  26. depends_on:
  27. - graphql-server
  28. volumes:
  29. - /data
  30. - /keystore
  31. ports:
  32. - '127.0.0.1:3333:${COLOSSUS_PORT}'
  33. env_file:
  34. # relative to working directory where docker-compose was run from
  35. - .env
  36. distributor-node:
  37. image: joystream/distributor-node
  38. restart: on-failure
  39. build:
  40. context: .
  41. dockerfile: distributor-node.Dockerfile
  42. depends_on:
  43. - graphql-server
  44. volumes:
  45. - /data
  46. - /cache
  47. ports:
  48. - 127.0.0.1:3334:3334
  49. # Node configuration can be overriden via env, for exampe:
  50. environment:
  51. # JOYSTREAM_DISTRIBUTOR__ID: node-id
  52. JOYSTREAM_DISTRIBUTOR__ENDPOINTS__QUERY_NODE: http://${GRAPHQL_SERVER_HOST}:${GRAPHQL_SERVER_PORT}/graphql
  53. # JOYSTREAM_DISTRIBUTOR__ENDPOINTS__SUBSTRATE_NODE: sn-endpoint
  54. # JOYSTREAM_DISTRIBUTOR__ENDPOINTS__ELASTIC_SEARCH: es-endpoint
  55. # JOYSTREAM_DISTRIBUTOR__DIRECTORIES__DATA: data-dir
  56. # JOYSTREAM_DISTRIBUTOR__DIRECTORIES__CACHE: cache-dir
  57. # JOYSTREAM_DISTRIBUTOR__DIRECTORIES__LOGS: logs-dir
  58. # JOYSTREAM_DISTRIBUTOR__LOG__CONSOLE: "off"
  59. # JOYSTREAM_DISTRIBUTOR__LOG__FILE: "off"
  60. # JOYSTREAM_DISTRIBUTOR__LOG__ELASTIC: "off"
  61. # JOYSTREAM_DISTRIBUTOR__LIMITS__STORAGE: 50G
  62. # JOYSTREAM_DISTRIBUTOR__PORT: 1234
  63. # JOYSTREAM_DISTRIBUTOR__KEYS: "[\"//Bob\"]"
  64. # JOYSTREAM_DISTRIBUTOR__BUCKETS: "[1,2]"
  65. # JOYSTREAM_DISTRIBUTOR__WORKER_ID: 0
  66. command: ['start']
  67. db:
  68. image: postgres:12
  69. restart: always
  70. ports:
  71. - '127.0.0.1:${DB_PORT}:5432'
  72. volumes:
  73. - /var/lib/postgresql/data
  74. env_file:
  75. # relative to working directory where docker-compose was run from
  76. - .env
  77. environment:
  78. POSTGRES_USER: ${DB_USER}
  79. POSTGRES_PASSWORD: ${DB_PASS}
  80. POSTGRES_DB: ${INDEXER_DB_NAME}
  81. graphql-server:
  82. image: joystream/apps
  83. restart: unless-stopped
  84. build:
  85. context: .
  86. dockerfile: apps.Dockerfile
  87. args:
  88. - WS_PROVIDER_ENDPOINT_URI=${WS_PROVIDER_ENDPOINT_URI}
  89. env_file:
  90. # relative to working directory where docker-compose was run from
  91. - .env
  92. ports:
  93. - '127.0.0.1:8081:${GRAPHQL_SERVER_PORT}'
  94. depends_on:
  95. - db
  96. command: ['workspace', 'query-node-root', 'query-node:start:prod']
  97. graphql-server-mnt:
  98. image: node:14
  99. restart: unless-stopped
  100. env_file:
  101. # relative to working directory where docker-compose was run from
  102. - .env
  103. ports:
  104. - '127.0.0.1:8081:${GRAPHQL_SERVER_PORT}'
  105. depends_on:
  106. - db
  107. volumes:
  108. - type: bind
  109. source: .
  110. target: /joystream
  111. working_dir: /joystream
  112. command: ['yarn', 'workspace', 'query-node-root', 'query-node:start:prod']
  113. processor:
  114. image: joystream/apps
  115. restart: unless-stopped
  116. build:
  117. context: .
  118. dockerfile: apps.Dockerfile
  119. args:
  120. - WS_PROVIDER_ENDPOINT_URI=${WS_PROVIDER_ENDPOINT_URI}
  121. env_file:
  122. # relative to working directory where docker-compose was run from
  123. - .env
  124. environment:
  125. - INDEXER_ENDPOINT_URL=http://hydra-indexer-gateway:${WARTHOG_APP_PORT}/graphql
  126. - TYPEORM_HOST=${DB_HOST}
  127. - TYPEORM_DATABASE=${DB_NAME}
  128. - WS_PROVIDER_ENDPOINT_URI=${WS_PROVIDER_ENDPOINT_URI}
  129. volumes:
  130. - ./types/augment/all/defs.json:/joystream/query-node/mappings/lib/generated/types/typedefs.json
  131. depends_on:
  132. - hydra-indexer-gateway
  133. command: ['workspace', 'query-node-root', 'processor:start']
  134. processor-mnt:
  135. image: node:14
  136. restart: unless-stopped
  137. env_file:
  138. # relative to working directory where docker-compose was run from
  139. - .env
  140. environment:
  141. - INDEXER_ENDPOINT_URL=http://hydra-indexer-gateway:${WARTHOG_APP_PORT}/graphql
  142. - TYPEORM_HOST=${DB_HOST}
  143. - TYPEORM_DATABASE=${DB_NAME}
  144. depends_on:
  145. - hydra-indexer-gateway
  146. volumes:
  147. - type: bind
  148. source: .
  149. target: /joystream
  150. working_dir: /joystream
  151. command: ['yarn', 'workspace', 'query-node-root', 'processor:start']
  152. indexer:
  153. image: joystream/hydra-indexer:3.0.0
  154. restart: unless-stopped
  155. env_file:
  156. # relative to working directory where docker-compose was run from
  157. - .env
  158. environment:
  159. - DB_NAME=${INDEXER_DB_NAME}
  160. - INDEXER_WORKERS=5
  161. - REDIS_URI=redis://redis:6379/0
  162. - TYPES_JSON=types.json
  163. depends_on:
  164. - db
  165. - redis
  166. volumes:
  167. - ./types/augment/all/defs.json:/home/hydra/packages/hydra-indexer/types.json
  168. command: >
  169. sh -c "yarn db:bootstrap && yarn start:prod"
  170. hydra-indexer-gateway:
  171. image: joystream/hydra-indexer-gateway:3.0.0
  172. restart: unless-stopped
  173. env_file:
  174. # relative to working directory where docker-compose was run from
  175. - .env
  176. environment:
  177. - WARTHOG_STARTER_DB_DATABASE=${INDEXER_DB_NAME}
  178. - WARTHOG_STARTER_DB_HOST=db
  179. - WARTHOG_STARTER_DB_PASSWORD=${DB_PASS}
  180. - WARTHOG_STARTER_DB_PORT=${DB_PORT}
  181. - WARTHOG_STARTER_DB_USERNAME=${DB_USER}
  182. - WARTHOG_STARTER_REDIS_URI=redis://redis:6379/0
  183. - WARTHOG_APP_PORT=${WARTHOG_APP_PORT}
  184. - PORT=${WARTHOG_APP_PORT}
  185. - DEBUG=*
  186. ports:
  187. - '127.0.0.1:4000:${WARTHOG_APP_PORT}'
  188. depends_on:
  189. - redis
  190. - db
  191. - indexer
  192. redis:
  193. image: redis:6.0-alpine
  194. restart: always
  195. ports:
  196. - '127.0.0.1:6379:6379'
  197. pioneer:
  198. image: joystream/pioneer
  199. build:
  200. context: .
  201. dockerfile: pioneer.Dockerfile
  202. ports:
  203. - '127.0.0.1:3000:80'