docker-compose.yml 6.1 KB

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