docker-compose.yml 6.6 KB

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