docker-compose.yml 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  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. # environment:
  53. # Configuration overrides can be defined here, for example:
  54. # JOYSTREAM_DISTRIBUTOR__ENDPOINTS__QUERY_NODE: http://graphql-server-mnt:4002/graphql
  55. # JOYSTREAM_DISTRIBUTOR__LOGS__ELASTIC: null
  56. command: ["start"]
  57. db:
  58. image: postgres:12
  59. restart: always
  60. ports:
  61. - "127.0.0.1:${DB_PORT}:5432"
  62. volumes:
  63. - /var/lib/postgresql/data
  64. env_file:
  65. # relative to working directory where docker-compose was run from
  66. - .env
  67. environment:
  68. POSTGRES_USER: ${DB_USER}
  69. POSTGRES_PASSWORD: ${DB_PASS}
  70. POSTGRES_DB: ${INDEXER_DB_NAME}
  71. graphql-server:
  72. image: joystream/apps
  73. restart: unless-stopped
  74. build:
  75. context: .
  76. dockerfile: apps.Dockerfile
  77. network: joystream_default
  78. args:
  79. - WS_PROVIDER_ENDPOINT_URI=${WS_PROVIDER_ENDPOINT_URI}
  80. env_file:
  81. # relative to working directory where docker-compose was run from
  82. - .env
  83. ports:
  84. - "127.0.0.1:8081:${GRAPHQL_SERVER_PORT}"
  85. depends_on:
  86. - db
  87. command: ["workspace", "query-node-root", "query-node:start:prod"]
  88. graphql-server-mnt:
  89. image: node:14
  90. restart: unless-stopped
  91. env_file:
  92. # relative to working directory where docker-compose was run from
  93. - .env
  94. ports:
  95. - "127.0.0.1:8081:${GRAPHQL_SERVER_PORT}"
  96. depends_on:
  97. - db
  98. volumes:
  99. - type: bind
  100. source: .
  101. target: /joystream
  102. working_dir: /joystream
  103. command: ["yarn", "workspace", "query-node-root", "query-node:start:prod"]
  104. processor:
  105. image: joystream/apps
  106. restart: unless-stopped
  107. build:
  108. context: .
  109. dockerfile: apps.Dockerfile
  110. network: joystream_default
  111. args:
  112. - WS_PROVIDER_ENDPOINT_URI=${WS_PROVIDER_ENDPOINT_URI}
  113. env_file:
  114. # relative to working directory where docker-compose was run from
  115. - .env
  116. environment:
  117. - INDEXER_ENDPOINT_URL=http://hydra-indexer-gateway:${WARTHOG_APP_PORT}/graphql
  118. - TYPEORM_HOST=${DB_HOST}
  119. - TYPEORM_DATABASE=${DB_NAME}
  120. - WS_PROVIDER_ENDPOINT_URI=${WS_PROVIDER_ENDPOINT_URI}
  121. volumes:
  122. - ./types/augment/all/defs.json:/joystream/query-node/mappings/lib/generated/types/typedefs.json
  123. depends_on:
  124. - hydra-indexer-gateway
  125. command: ["workspace", "query-node-root", "processor:start"]
  126. processor-mnt:
  127. image: node:14
  128. restart: unless-stopped
  129. env_file:
  130. # relative to working directory where docker-compose was run from
  131. - .env
  132. environment:
  133. - INDEXER_ENDPOINT_URL=http://hydra-indexer-gateway:${WARTHOG_APP_PORT}/graphql
  134. - TYPEORM_HOST=${DB_HOST}
  135. - TYPEORM_DATABASE=${DB_NAME}
  136. depends_on:
  137. - hydra-indexer-gateway
  138. volumes:
  139. - type: bind
  140. source: .
  141. target: /joystream
  142. working_dir: /joystream
  143. command: ["yarn", "workspace", "query-node-root", "processor:start"]
  144. indexer:
  145. image: joystream/hydra-indexer:3.0.0
  146. restart: unless-stopped
  147. env_file:
  148. # relative to working directory where docker-compose was run from
  149. - .env
  150. environment:
  151. - DB_NAME=${INDEXER_DB_NAME}
  152. - INDEXER_WORKERS=5
  153. - REDIS_URI=redis://redis:6379/0
  154. - TYPES_JSON=types.json
  155. depends_on:
  156. - db
  157. - redis
  158. volumes:
  159. - ./types/augment/all/defs.json:/home/hydra/packages/hydra-indexer/types.json
  160. command: >
  161. sh -c "yarn db:bootstrap && yarn start:prod"
  162. hydra-indexer-gateway:
  163. image: joystream/hydra-indexer-gateway:3.0.0
  164. restart: unless-stopped
  165. env_file:
  166. # relative to working directory where docker-compose was run from
  167. - .env
  168. environment:
  169. - WARTHOG_STARTER_DB_DATABASE=${INDEXER_DB_NAME}
  170. - WARTHOG_STARTER_DB_HOST=db
  171. - WARTHOG_STARTER_DB_PASSWORD=${DB_PASS}
  172. - WARTHOG_STARTER_DB_PORT=${DB_PORT}
  173. - WARTHOG_STARTER_DB_USERNAME=${DB_USER}
  174. - WARTHOG_STARTER_REDIS_URI=redis://redis:6379/0
  175. - WARTHOG_APP_PORT=${WARTHOG_APP_PORT}
  176. - PORT=${WARTHOG_APP_PORT}
  177. - DEBUG=*
  178. ports:
  179. - "127.0.0.1:4000:${WARTHOG_APP_PORT}"
  180. depends_on:
  181. - redis
  182. - db
  183. - indexer
  184. redis:
  185. image: redis:6.0-alpine
  186. restart: always
  187. ports:
  188. - "127.0.0.1:6379:6379"
  189. pioneer:
  190. image: joystream/pioneer
  191. build:
  192. context: .
  193. dockerfile: pioneer.Dockerfile
  194. ports:
  195. - "127.0.0.1:3000:80"