docker-compose.yml 6.6 KB

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