docker-compose.yml 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  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:giza
  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-giza
  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
  28. volumes:
  29. - /data
  30. - /keystore
  31. ports:
  32. - '127.0.0.1:3333:${COLOSSUS_PORT}'
  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_HOST=graphql-server-mnt:${GRAPHQL_SERVER_PORT}
  39. - WORKER_ID=0
  40. - ACCOUNT_URI=//Alice
  41. # enable ElasticSearch server
  42. # - ELASTIC_SEARCH_HOST=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. depends_on:
  50. - graphql-server
  51. volumes:
  52. - /data
  53. - /cache
  54. ports:
  55. - 127.0.0.1:3334:3334
  56. # Node configuration can be overriden via env, for exampe:
  57. environment:
  58. # JOYSTREAM_DISTRIBUTOR__ID: node-id
  59. JOYSTREAM_DISTRIBUTOR__ENDPOINTS__QUERY_NODE: http://${GRAPHQL_SERVER_HOST}:${GRAPHQL_SERVER_PORT}/graphql
  60. # JOYSTREAM_DISTRIBUTOR__ENDPOINTS__JOYSTREAM_NODE_WS: sn-endpoint
  61. # JOYSTREAM_DISTRIBUTOR__ENDPOINTS__ELASTIC_SEARCH: es-endpoint
  62. # JOYSTREAM_DISTRIBUTOR__DIRECTORIES__ASSETS: assets-dir
  63. # JOYSTREAM_DISTRIBUTOR__DIRECTORIES__CACHE_STATE: cache-state-dir
  64. # JOYSTREAM_DISTRIBUTOR__DIRECTORIES__LOGS: logs-dir
  65. # JOYSTREAM_DISTRIBUTOR__LOG__CONSOLE: "off"
  66. # JOYSTREAM_DISTRIBUTOR__LOG__FILE: "off"
  67. # JOYSTREAM_DISTRIBUTOR__LOG__ELASTIC: "off"
  68. # JOYSTREAM_DISTRIBUTOR__LIMITS__STORAGE: 50G
  69. # JOYSTREAM_DISTRIBUTOR__PORT: 1234
  70. # JOYSTREAM_DISTRIBUTOR__KEYS="[{\"suri\":\"//Bob\"}]"
  71. # JOYSTREAM_DISTRIBUTOR__BUCKETS: "[1,2]"
  72. # JOYSTREAM_DISTRIBUTOR__WORKER_ID: 0
  73. command: ["start"]
  74. db:
  75. image: postgres:12
  76. restart: always
  77. ports:
  78. - '127.0.0.1:${DB_PORT}:5432'
  79. volumes:
  80. - /var/lib/postgresql/data
  81. env_file:
  82. # relative to working directory where docker-compose was run from
  83. - .env
  84. environment:
  85. POSTGRES_USER: ${DB_USER}
  86. POSTGRES_PASSWORD: ${DB_PASS}
  87. POSTGRES_DB: ${INDEXER_DB_NAME}
  88. graphql-server:
  89. image: joystream/apps
  90. restart: unless-stopped
  91. build:
  92. context: .
  93. dockerfile: apps.Dockerfile
  94. args:
  95. - WS_PROVIDER_ENDPOINT_URI=${WS_PROVIDER_ENDPOINT_URI}
  96. env_file:
  97. # relative to working directory where docker-compose was run from
  98. - .env
  99. ports:
  100. - '127.0.0.1:8081:${GRAPHQL_SERVER_PORT}'
  101. depends_on:
  102. - db
  103. command: ['workspace', 'query-node-root', 'query-node:start:prod']
  104. graphql-server-mnt:
  105. image: node:14
  106. restart: unless-stopped
  107. env_file:
  108. # relative to working directory where docker-compose was run from
  109. - .env
  110. ports:
  111. - '127.0.0.1:8081:${GRAPHQL_SERVER_PORT}'
  112. depends_on:
  113. - db
  114. volumes:
  115. - type: bind
  116. source: .
  117. target: /joystream
  118. working_dir: /joystream
  119. command: ['yarn', 'workspace', 'query-node-root', 'query-node:start:prod']
  120. processor:
  121. image: joystream/apps
  122. restart: unless-stopped
  123. build:
  124. context: .
  125. dockerfile: apps.Dockerfile
  126. args:
  127. - WS_PROVIDER_ENDPOINT_URI=${WS_PROVIDER_ENDPOINT_URI}
  128. env_file:
  129. # relative to working directory where docker-compose was run from
  130. - .env
  131. environment:
  132. - INDEXER_ENDPOINT_URL=http://hydra-indexer-gateway:${WARTHOG_APP_PORT}/graphql
  133. - TYPEORM_HOST=${DB_HOST}
  134. - TYPEORM_DATABASE=${DB_NAME}
  135. - WS_PROVIDER_ENDPOINT_URI=${WS_PROVIDER_ENDPOINT_URI}
  136. volumes:
  137. - ./types/augment/all/defs.json:/joystream/query-node/mappings/lib/generated/types/typedefs.json
  138. depends_on:
  139. - hydra-indexer-gateway
  140. command: ['workspace', 'query-node-root', 'processor:start']
  141. processor-mnt:
  142. image: node:14
  143. restart: unless-stopped
  144. env_file:
  145. # relative to working directory where docker-compose was run from
  146. - .env
  147. environment:
  148. - INDEXER_ENDPOINT_URL=http://hydra-indexer-gateway:${WARTHOG_APP_PORT}/graphql
  149. - TYPEORM_HOST=${DB_HOST}
  150. - TYPEORM_DATABASE=${DB_NAME}
  151. depends_on:
  152. - hydra-indexer-gateway
  153. volumes:
  154. - type: bind
  155. source: .
  156. target: /joystream
  157. working_dir: /joystream
  158. command: ['yarn', 'workspace', 'query-node-root', 'processor:start']
  159. indexer:
  160. image: joystream/hydra-indexer:3.0.0
  161. restart: unless-stopped
  162. env_file:
  163. # relative to working directory where docker-compose was run from
  164. - .env
  165. environment:
  166. - DB_NAME=${INDEXER_DB_NAME}
  167. - INDEXER_WORKERS=5
  168. - REDIS_URI=redis://redis:6379/0
  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:${WARTHOG_APP_PORT}'
  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'