docker-compose.yml 6.9 KB

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