docker-compose.yml 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  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. colossus:
  21. image: joystream/colossus:latest
  22. restart: on-failure
  23. build:
  24. context: .
  25. dockerfile: colossus.Dockerfile
  26. depends_on:
  27. - graphql-server-mnt
  28. volumes:
  29. - /data
  30. - /keystore
  31. ports:
  32. - '127.0.0.1:3333:3333'
  33. env_file:
  34. # relative to working directory where docker-compose was run from
  35. - .env
  36. environment:
  37. - COLOSSUS_PORT=3333
  38. - QUERY_NODE_ENDPOINT=http://graphql-server-mnt:${GRAPHQL_SERVER_PORT}/graphql
  39. - WORKER_ID=0
  40. - ACCOUNT_URI=//Alice
  41. # enable ElasticSearch server
  42. # - ELASTIC_SEARCH_ENDPOINT=host.docker.internal:9200
  43. distributor-node:
  44. image: joystream/distributor-node
  45. restart: on-failure
  46. build:
  47. context: .
  48. dockerfile: distributor-node.Dockerfile
  49. volumes:
  50. - /data
  51. - /cache
  52. ports:
  53. - 127.0.0.1:3334:3334
  54. # Node configuration can be overriden via env, for exampe:
  55. # environment:
  56. # JOYSTREAM_DISTRIBUTOR__ID: node-id
  57. # JOYSTREAM_DISTRIBUTOR__ENDPOINTS__QUERY_NODE: qn-endpoint
  58. # JOYSTREAM_DISTRIBUTOR__ENDPOINTS__JOYSTREAM_NODE_WS: sn-endpoint
  59. # JOYSTREAM_DISTRIBUTOR__DIRECTORIES__ASSETS: assets-dir
  60. # JOYSTREAM_DISTRIBUTOR__DIRECTORIES__CACHE_STATE: cache-state-dir
  61. # JOYSTREAM_DISTRIBUTOR__LOGS__CONSOLE: "off"
  62. # JOYSTREAM_DISTRIBUTOR__LOGS__FILE__LEVEL: debug
  63. # JOYSTREAM_DISTRIBUTOR__LOGS__FILE__PATH: /tmp
  64. # JOYSTREAM_DISTRIBUTOR__LOGS__ELASTIC: "off"
  65. # JOYSTREAM_DISTRIBUTOR__LIMITS__STORAGE: 50G
  66. # JOYSTREAM_DISTRIBUTOR__PORT: 1234
  67. # JOYSTREAM_DISTRIBUTOR__KEYS: "[{\"suri\":\"//Bob\"}]"
  68. # JOYSTREAM_DISTRIBUTOR__BUCKETS: "[\"1:0\",\"1:1\"]"
  69. # JOYSTREAM_DISTRIBUTOR__WORKER_ID: 0
  70. command: ["start"]
  71. db:
  72. image: postgres:12
  73. restart: always
  74. ports:
  75. - "127.0.0.1:${DB_PORT}:5432"
  76. volumes:
  77. - /var/lib/postgresql/data
  78. env_file:
  79. # relative to working directory where docker-compose was run from
  80. - .env
  81. environment:
  82. POSTGRES_USER: ${DB_USER}
  83. POSTGRES_PASSWORD: ${DB_PASS}
  84. POSTGRES_DB: ${INDEXER_DB_NAME}
  85. graphql-server:
  86. image: joystream/apps
  87. restart: unless-stopped
  88. build:
  89. context: .
  90. dockerfile: apps.Dockerfile
  91. network: joystream_default
  92. env_file:
  93. # relative to working directory where docker-compose was run from
  94. - .env
  95. ports:
  96. - "127.0.0.1:8081:${GRAPHQL_SERVER_PORT}"
  97. depends_on:
  98. - db
  99. command: ["workspace", "query-node-root", "query-node:start:prod"]
  100. graphql-server-mnt:
  101. image: node:14
  102. restart: unless-stopped
  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. 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. network: joystream_default
  123. env_file:
  124. # relative to working directory where docker-compose was run from
  125. - .env
  126. environment:
  127. - INDEXER_ENDPOINT_URL=http://hydra-indexer-gateway:${WARTHOG_APP_PORT}/graphql
  128. - TYPEORM_HOST=${DB_HOST}
  129. - TYPEORM_DATABASE=${DB_NAME}
  130. - WS_PROVIDER_ENDPOINT_URI=${WS_PROVIDER_ENDPOINT_URI}
  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_HOST}
  145. - TYPEORM_DATABASE=${DB_NAME}
  146. depends_on:
  147. - hydra-indexer-gateway
  148. volumes:
  149. - type: bind
  150. source: .
  151. target: /joystream
  152. working_dir: /joystream
  153. command: ["yarn", "workspace", "query-node-root", "processor:start"]
  154. indexer:
  155. image: joystream/hydra-indexer:3.0.0
  156. restart: unless-stopped
  157. env_file:
  158. # relative to working directory where docker-compose was run from
  159. - .env
  160. environment:
  161. - DB_NAME=${INDEXER_DB_NAME}
  162. - INDEXER_WORKERS=5
  163. - REDIS_URI=redis://redis:6379/0
  164. - TYPES_JSON=types.json
  165. depends_on:
  166. - db
  167. - redis
  168. volumes:
  169. - ./types/augment/all/defs.json:/home/hydra/packages/hydra-indexer/types.json
  170. command: >
  171. sh -c "yarn db:bootstrap && yarn start:prod"
  172. hydra-indexer-gateway:
  173. image: joystream/hydra-indexer-gateway: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. - WARTHOG_STARTER_DB_DATABASE=${INDEXER_DB_NAME}
  180. - WARTHOG_STARTER_DB_HOST=db
  181. - WARTHOG_STARTER_DB_PASSWORD=${DB_PASS}
  182. - WARTHOG_STARTER_DB_PORT=${DB_PORT}
  183. - WARTHOG_STARTER_DB_USERNAME=${DB_USER}
  184. - WARTHOG_STARTER_REDIS_URI=redis://redis:6379/0
  185. - WARTHOG_APP_PORT=${WARTHOG_APP_PORT}
  186. - PORT=${WARTHOG_APP_PORT}
  187. - DEBUG=*
  188. ports:
  189. - "127.0.0.1:4000:${WARTHOG_APP_PORT}"
  190. depends_on:
  191. - redis
  192. - db
  193. - indexer
  194. redis:
  195. image: redis:6.0-alpine
  196. restart: always
  197. ports:
  198. - "127.0.0.1:6379:6379"
  199. pioneer:
  200. image: joystream/pioneer
  201. build:
  202. context: .
  203. dockerfile: pioneer.Dockerfile
  204. ports:
  205. - "127.0.0.1:3000:80"