docker-compose.yml 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327
  1. # Complete joystream development network
  2. version: '3.4'
  3. services:
  4. joystream-node:
  5. image: joystream/node:$JOYSTREAM_NODE_TAG
  6. restart: unless-stopped
  7. container_name: joystream-node
  8. volumes:
  9. - chain-data:/data
  10. command: --dev --alice --validator --unsafe-ws-external --unsafe-rpc-external --rpc-methods Safe --rpc-cors=all --log runtime --base-path /data
  11. ports:
  12. - 9944:9944
  13. - 9933:9933
  14. colossus-1:
  15. image: node:14
  16. container_name: colossus-1
  17. restart: on-failure
  18. volumes:
  19. - colossus-1-data:/data
  20. - colossus-1-keystore:/keystore
  21. - colossus-1-logs:/logs
  22. - type: bind
  23. source: .
  24. target: /joystream
  25. working_dir: /joystream/storage-node
  26. ports:
  27. - 3333:3333
  28. env_file:
  29. # relative to working directory where docker-compose was run from
  30. - .env
  31. environment:
  32. # ACCOUNT_URI overrides command line arg --accountUri
  33. - ACCOUNT_URI=${COLOSSUS_1_TRANSACTOR_URI}
  34. command: [
  35. 'yarn', 'storage-node', 'server', '--worker=${COLOSSUS_1_WORKER_ID}', '--port=3333', '--uploads=/data',
  36. '--sync', '--syncInterval=1',
  37. '--queryNodeEndpoint=${COLOSSUS_QUERY_NODE_URL}',
  38. '--apiUrl=${JOYSTREAM_NODE_WS}',
  39. '--logFilePath=/logs'
  40. ]
  41. distributor-1:
  42. image: node:14
  43. container_name: distributor-1
  44. restart: on-failure
  45. volumes:
  46. - distributor-1-data:/data
  47. - distributor-1-cache:/cache
  48. - distributor-1-logs:/logs
  49. - type: bind
  50. source: .
  51. target: /joystream
  52. # let the working_dir be the distributor node to pickup the config.yml file
  53. working_dir: /joystream/distributor-node
  54. ports:
  55. - 3334:3334
  56. - 127.0.0.1:4334:4334
  57. env_file:
  58. # relative to working directory where docker-compose was run from
  59. - .env
  60. # Node configuration can be overriden via env, for exampe:
  61. environment:
  62. JOYSTREAM_DISTRIBUTOR__ID: distributor-1
  63. JOYSTREAM_DISTRIBUTOR__ENDPOINTS__QUERY_NODE: ${DISTRIBUTOR_QUERY_NODE_URL}
  64. JOYSTREAM_DISTRIBUTOR__KEYS: "[{\"suri\":\"${DISTRIBUTOR_1_ACCOUNT_URI}\"}]"
  65. JOYSTREAM_DISTRIBUTOR__WORKER_ID: ${DISTRIBUTOR_1_WORKER_ID}
  66. JOYSTREAM_DISTRIBUTOR__PUBLIC_API__PORT: 3334
  67. JOYSTREAM_DISTRIBUTOR__OPERATOR_API__PORT: 4334
  68. JOYSTREAM_DISTRIBUTOR__ENDPOINTS__JOYSTREAM_NODE_WS: ${JOYSTREAM_NODE_WS}
  69. JOYSTREAM_DISTRIBUTOR__DIRECTORIES__ASSETS: /data
  70. JOYSTREAM_DISTRIBUTOR__DIRECTORIES__CACHE_STATE: /cache
  71. JOYSTREAM_DISTRIBUTOR__LOGS__FILE__PATH: /logs
  72. # JOYSTREAM_DISTRIBUTOR__ENDPOINTS__ELASTIC_SEARCH: es-endpoint
  73. # JOYSTREAM_DISTRIBUTOR__LOGS__CONSOLE: "off"
  74. # JOYSTREAM_DISTRIBUTOR__LOGS__FILE: "off"
  75. # JOYSTREAM_DISTRIBUTOR__LOGS__ELASTIC: "off"
  76. # JOYSTREAM_DISTRIBUTOR__LIMITS__STORAGE: 50G
  77. # JOYSTREAM_DISTRIBUTOR__BUCKETS: "[\"1:0\",\"1:1\"]"
  78. command: ['yarn', 'joystream-distributor', 'start']
  79. colossus-2:
  80. image: node:14
  81. container_name: colossus-2
  82. restart: on-failure
  83. volumes:
  84. - colossus-2-data:/data
  85. - colossus-2-keystore:/keystore
  86. - colossus-2-logs:/logs
  87. - type: bind
  88. source: .
  89. target: /joystream
  90. working_dir: /joystream/storage-node
  91. ports:
  92. - 3335:3333
  93. env_file:
  94. # relative to working directory where docker-compose was run from
  95. - .env
  96. environment:
  97. # ACCOUNT_URI overrides command line arg --accountUri
  98. - ACCOUNT_URI=${COLOSSUS_2_TRANSACTOR_URI}
  99. command: [
  100. 'yarn', 'storage-node', 'server', '--worker=${COLOSSUS_2_WORKER_ID}', '--port=3333', '--uploads=/data',
  101. '--sync', '--syncInterval=1',
  102. '--queryNodeEndpoint=${COLOSSUS_QUERY_NODE_URL}',
  103. '--apiUrl=${JOYSTREAM_NODE_WS}',
  104. '--logFilePath=/logs'
  105. ]
  106. distributor-2:
  107. image: node:14
  108. container_name: distributor-2
  109. restart: on-failure
  110. volumes:
  111. - distributor-2-data:/data
  112. - distributor-2-cache:/cache
  113. - distributor-2-logs:/logs
  114. - type: bind
  115. source: .
  116. target: /joystream
  117. # let the working_dir be the distributor node to pickup the config.yml file
  118. working_dir: /joystream/distributor-node
  119. ports:
  120. - 3336:3334
  121. - 127.0.0.1:4336:4334
  122. env_file:
  123. # relative to working directory where docker-compose was run from
  124. - .env
  125. # Node configuration can be overriden via env, for exampe:
  126. environment:
  127. JOYSTREAM_DISTRIBUTOR__ID: distributor-2
  128. JOYSTREAM_DISTRIBUTOR__ENDPOINTS__QUERY_NODE: ${DISTRIBUTOR_QUERY_NODE_URL}
  129. JOYSTREAM_DISTRIBUTOR__KEYS: "[{\"suri\":\"${DISTRIBUTOR_2_ACCOUNT_URI}\"}]"
  130. JOYSTREAM_DISTRIBUTOR__WORKER_ID: ${DISTRIBUTOR_2_WORKER_ID}
  131. JOYSTREAM_DISTRIBUTOR__PUBLIC_API__PORT: 3334
  132. JOYSTREAM_DISTRIBUTOR__OPERATOR_API__PORT: 4334
  133. JOYSTREAM_DISTRIBUTOR__ENDPOINTS__JOYSTREAM_NODE_WS: ${JOYSTREAM_NODE_WS}
  134. JOYSTREAM_DISTRIBUTOR__DIRECTORIES__ASSETS: /data
  135. JOYSTREAM_DISTRIBUTOR__DIRECTORIES__CACHE_STATE: /cache
  136. JOYSTREAM_DISTRIBUTOR__LOGS__FILE__PATH: /logs
  137. # JOYSTREAM_DISTRIBUTOR__ENDPOINTS__ELASTIC_SEARCH: es-endpoint
  138. # JOYSTREAM_DISTRIBUTOR__LOGS__CONSOLE: "off"
  139. # JOYSTREAM_DISTRIBUTOR__LOGS__FILE: "off"
  140. # JOYSTREAM_DISTRIBUTOR__LOGS__ELASTIC: "off"
  141. # JOYSTREAM_DISTRIBUTOR__LIMITS__STORAGE: 50G
  142. # JOYSTREAM_DISTRIBUTOR__BUCKETS: "[\"1:0\",\"1:1\"]"
  143. command: ['yarn', 'joystream-distributor', 'start']
  144. db:
  145. image: postgres:12
  146. container_name: db
  147. restart: unless-stopped
  148. ports:
  149. - '127.0.0.1:${DB_PORT}:${DB_PORT}'
  150. volumes:
  151. - query-node-data:/var/lib/postgresql/data
  152. env_file:
  153. # relative to working directory where docker-compose was run from
  154. - .env
  155. environment:
  156. POSTGRES_USER: ${DB_USER}
  157. POSTGRES_PASSWORD: ${DB_PASS}
  158. POSTGRES_DB: ${INDEXER_DB_NAME}
  159. PGPORT: ${DB_PORT}
  160. graphql-server:
  161. image: node:14
  162. container_name: graphql-server
  163. restart: unless-stopped
  164. env_file:
  165. # relative to working directory where docker-compose was run from
  166. - .env
  167. environment:
  168. - DB_HOST=db
  169. - WARTHOG_APP_PORT=${GRAPHQL_SERVER_PORT}
  170. - GRAPHQL_PLAYGROUND_ENDPOINT=${GRAPHQL_PLAYGROUND_ENDPOINT}
  171. - GRAPHQL_PLAYGROUND_SUBSCRIPTION_ENDPOINT=${GRAPHQL_PLAYGROUND_SUBSCRIPTION_ENDPOINT}
  172. - GRAPHQL_PLAYGROUND_CDN_URL=${GRAPHQL_PLAYGROUND_CDN_URL}
  173. ports:
  174. - "${GRAPHQL_SERVER_PORT}:${GRAPHQL_SERVER_PORT}"
  175. depends_on:
  176. - db
  177. volumes:
  178. - type: bind
  179. source: .
  180. target: /joystream
  181. working_dir: /joystream
  182. command: ['yarn', 'workspace', 'query-node-root', 'query-node:start:prod']
  183. processor:
  184. image: node:14
  185. container_name: processor
  186. restart: unless-stopped
  187. env_file:
  188. # relative to working directory where docker-compose was run from
  189. - .env
  190. environment:
  191. - INDEXER_ENDPOINT_URL=${PROCESSOR_INDEXER_GATEWAY}
  192. - TYPEORM_HOST=db
  193. - TYPEORM_DATABASE=${DB_NAME}
  194. depends_on:
  195. - db
  196. volumes:
  197. - type: bind
  198. source: .
  199. target: /joystream
  200. working_dir: /joystream
  201. command: ['yarn', 'workspace', 'query-node-root', 'processor:start']
  202. indexer:
  203. image: joystream/hydra-indexer:3.0.0
  204. container_name: indexer
  205. restart: unless-stopped
  206. env_file:
  207. # relative to working directory where docker-compose was run from
  208. - .env
  209. environment:
  210. - DB_NAME=${INDEXER_DB_NAME}
  211. - INDEXER_WORKERS=5
  212. - REDIS_URI=redis://redis:6379/0
  213. - TYPES_JSON=types.json
  214. - WS_PROVIDER_ENDPOINT_URI=${JOYSTREAM_NODE_WS}
  215. - DB_HOST=db
  216. depends_on:
  217. - db
  218. - redis
  219. volumes:
  220. - ./types/augment/all/defs.json:/home/hydra/packages/hydra-indexer/types.json
  221. command: >
  222. sh -c "yarn db:bootstrap && yarn start:prod"
  223. hydra-indexer-gateway:
  224. image: joystream/hydra-indexer-gateway:3.0.0
  225. container_name: hydra-indexer-gateway
  226. restart: unless-stopped
  227. env_file:
  228. # relative to working directory where docker-compose was run from
  229. - .env
  230. environment:
  231. - WARTHOG_STARTER_DB_DATABASE=${INDEXER_DB_NAME}
  232. - WARTHOG_STARTER_DB_HOST=db
  233. - WARTHOG_STARTER_DB_PASSWORD=${DB_PASS}
  234. - WARTHOG_STARTER_DB_PORT=${DB_PORT}
  235. - WARTHOG_STARTER_DB_USERNAME=${DB_USER}
  236. - WARTHOG_STARTER_REDIS_URI=redis://redis:6379/0
  237. - WARTHOG_APP_PORT=${HYDRA_INDEXER_GATEWAY_PORT}
  238. - PORT=${HYDRA_INDEXER_GATEWAY_PORT}
  239. - DEBUG=*
  240. ports:
  241. - "${HYDRA_INDEXER_GATEWAY_PORT}:${HYDRA_INDEXER_GATEWAY_PORT}"
  242. depends_on:
  243. - db
  244. - redis
  245. redis:
  246. image: redis:6.0-alpine
  247. container_name: redis
  248. restart: unless-stopped
  249. ports:
  250. - "127.0.0.1:6379:6379"
  251. faucet:
  252. image: joystream/faucet:olympia
  253. restart: on-failure
  254. container_name: faucet
  255. env_file:
  256. - .env
  257. environment:
  258. - SCREENING_AUTHORITY_SEED=${SCREENING_AUTHORITY_SEED}
  259. - PORT=3002
  260. - INVITING_MEMBER_ID=${INVITING_MEMBER_ID}
  261. - PROVIDER=${JOYSTREAM_NODE_WS}
  262. ports:
  263. - "3002:3002"
  264. orion:
  265. container_name: orion
  266. image: joystream/orion
  267. environment:
  268. - ORION_PORT=6116
  269. - ORION_MONGO_HOSTNAME=mongo
  270. - ORION_FEATURED_CONTENT_SECRET=password123
  271. - ORION_QUERY_NODE_URL=http://graphql-server:${GRAPHQL_SERVER_PORT}/graphql
  272. ports:
  273. - "6116:6116"
  274. depends_on:
  275. - mongo
  276. restart: always
  277. mongo:
  278. restart: always
  279. container_name: mongo
  280. image: library/mongo:4.4
  281. volumes:
  282. - orion-mongo-data:/data/db
  283. volumes:
  284. chain-data:
  285. driver: local
  286. query-node-data:
  287. driver: local
  288. colossus-1-data:
  289. driver: local
  290. colossus-1-keystore:
  291. driver: local
  292. colossus-1-logs:
  293. driver: local
  294. colossus-2-data:
  295. driver: local
  296. colossus-2-keystore:
  297. driver: local
  298. colossus-2-logs:
  299. driver: local
  300. distributor-1-logs:
  301. driver: local
  302. distributor-1-cache:
  303. driver: local
  304. distributor-1-data:
  305. driver: local
  306. distributor-2-logs:
  307. driver: local
  308. distributor-2-cache:
  309. driver: local
  310. distributor-2-data:
  311. driver: local
  312. orion-mongo-data:
  313. driver: local