docker-compose.yml 6.4 KB

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