docker-compose.yml 6.4 KB

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