docker-compose.yml 5.3 KB

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