docker-compose.yml 6.6 KB

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