docker-compose.yml 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  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. args:
  102. - WS_PROVIDER_ENDPOINT_URI=${WS_PROVIDER_ENDPOINT_URI}
  103. env_file:
  104. # relative to working directory where docker-compose was run from
  105. - .env
  106. ports:
  107. - "127.0.0.1:8081:${GRAPHQL_SERVER_PORT}"
  108. depends_on:
  109. - db
  110. command: ["workspace", "query-node-root", "query-node:start:prod"]
  111. graphql-server-mnt:
  112. image: node:14
  113. restart: unless-stopped
  114. env_file:
  115. # relative to working directory where docker-compose was run from
  116. - .env
  117. ports:
  118. - "127.0.0.1:8081:${GRAPHQL_SERVER_PORT}"
  119. depends_on:
  120. - db
  121. volumes:
  122. - type: bind
  123. source: .
  124. target: /joystream
  125. working_dir: /joystream
  126. command: ["yarn", "workspace", "query-node-root", "query-node:start:prod"]
  127. processor:
  128. image: joystream/apps
  129. restart: unless-stopped
  130. build:
  131. context: .
  132. dockerfile: apps.Dockerfile
  133. network: joystream_default
  134. args:
  135. - WS_PROVIDER_ENDPOINT_URI=${WS_PROVIDER_ENDPOINT_URI}
  136. env_file:
  137. # relative to working directory where docker-compose was run from
  138. - .env
  139. environment:
  140. - INDEXER_ENDPOINT_URL=http://hydra-indexer-gateway:${WARTHOG_APP_PORT}/graphql
  141. - TYPEORM_HOST=${DB_HOST}
  142. - TYPEORM_DATABASE=${DB_NAME}
  143. - WS_PROVIDER_ENDPOINT_URI=${WS_PROVIDER_ENDPOINT_URI}
  144. volumes:
  145. - ./types/augment/all/defs.json:/joystream/query-node/mappings/lib/generated/types/typedefs.json
  146. depends_on:
  147. - hydra-indexer-gateway
  148. command: ["workspace", "query-node-root", "processor:start"]
  149. processor-mnt:
  150. image: node:14
  151. restart: unless-stopped
  152. env_file:
  153. # relative to working directory where docker-compose was run from
  154. - .env
  155. environment:
  156. - INDEXER_ENDPOINT_URL=http://hydra-indexer-gateway:${WARTHOG_APP_PORT}/graphql
  157. - TYPEORM_HOST=${DB_HOST}
  158. - TYPEORM_DATABASE=${DB_NAME}
  159. depends_on:
  160. - hydra-indexer-gateway
  161. volumes:
  162. - type: bind
  163. source: .
  164. target: /joystream
  165. working_dir: /joystream
  166. command: ["yarn", "workspace", "query-node-root", "processor:start"]
  167. indexer:
  168. image: joystream/hydra-indexer:3.0.0
  169. restart: unless-stopped
  170. env_file:
  171. # relative to working directory where docker-compose was run from
  172. - .env
  173. environment:
  174. - DB_NAME=${INDEXER_DB_NAME}
  175. - INDEXER_WORKERS=5
  176. - REDIS_URI=redis://redis:6379/0
  177. - TYPES_JSON=types.json
  178. depends_on:
  179. - db
  180. - redis
  181. volumes:
  182. - ./types/augment/all/defs.json:/home/hydra/packages/hydra-indexer/types.json
  183. command: >
  184. sh -c "yarn db:bootstrap && yarn start:prod"
  185. hydra-indexer-gateway:
  186. image: joystream/hydra-indexer-gateway:3.0.0
  187. restart: unless-stopped
  188. env_file:
  189. # relative to working directory where docker-compose was run from
  190. - .env
  191. environment:
  192. - WARTHOG_STARTER_DB_DATABASE=${INDEXER_DB_NAME}
  193. - WARTHOG_STARTER_DB_HOST=db
  194. - WARTHOG_STARTER_DB_PASSWORD=${DB_PASS}
  195. - WARTHOG_STARTER_DB_PORT=${DB_PORT}
  196. - WARTHOG_STARTER_DB_USERNAME=${DB_USER}
  197. - WARTHOG_STARTER_REDIS_URI=redis://redis:6379/0
  198. - WARTHOG_APP_PORT=${WARTHOG_APP_PORT}
  199. - PORT=${WARTHOG_APP_PORT}
  200. - DEBUG=*
  201. ports:
  202. - "127.0.0.1:4000:${WARTHOG_APP_PORT}"
  203. depends_on:
  204. - redis
  205. - db
  206. - indexer
  207. redis:
  208. image: redis:6.0-alpine
  209. restart: always
  210. ports:
  211. - "127.0.0.1:6379:6379"
  212. pioneer:
  213. image: joystream/pioneer
  214. build:
  215. context: .
  216. dockerfile: pioneer.Dockerfile
  217. ports:
  218. - "127.0.0.1:3000:80"