docker-compose.yml 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333
  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. ports:
  171. - "${GRAPHQL_SERVER_PORT}:${GRAPHQL_SERVER_PORT}"
  172. depends_on:
  173. - db
  174. volumes:
  175. - type: bind
  176. source: .
  177. target: /joystream
  178. working_dir: /joystream
  179. command: ['yarn', 'workspace', 'query-node-root', 'query-node:start:prod']
  180. processor:
  181. image: node:14
  182. container_name: processor
  183. restart: unless-stopped
  184. env_file:
  185. # relative to working directory where docker-compose was run from
  186. - .env
  187. environment:
  188. - INDEXER_ENDPOINT_URL=${PROCESSOR_INDEXER_GATEWAY}
  189. - TYPEORM_HOST=db
  190. - TYPEORM_DATABASE=${DB_NAME}
  191. depends_on:
  192. - db
  193. volumes:
  194. - type: bind
  195. source: .
  196. target: /joystream
  197. working_dir: /joystream
  198. command: ['yarn', 'workspace', 'query-node-root', 'processor:start']
  199. indexer:
  200. image: joystream/hydra-indexer:3.0.0
  201. container_name: indexer
  202. restart: unless-stopped
  203. env_file:
  204. # relative to working directory where docker-compose was run from
  205. - .env
  206. environment:
  207. - DB_NAME=${INDEXER_DB_NAME}
  208. - INDEXER_WORKERS=5
  209. - REDIS_URI=redis://redis:6379/0
  210. - TYPES_JSON=types.json
  211. - WS_PROVIDER_ENDPOINT_URI=${JOYSTREAM_NODE_WS}
  212. - DB_HOST=db
  213. depends_on:
  214. - db
  215. - redis
  216. volumes:
  217. - ./types/augment/all/defs.json:/home/hydra/packages/hydra-indexer/types.json
  218. command: >
  219. sh -c "yarn db:bootstrap && yarn start:prod"
  220. hydra-indexer-gateway:
  221. image: joystream/hydra-indexer-gateway:3.0.0
  222. container_name: hydra-indexer-gateway
  223. restart: unless-stopped
  224. env_file:
  225. # relative to working directory where docker-compose was run from
  226. - .env
  227. environment:
  228. - WARTHOG_STARTER_DB_DATABASE=${INDEXER_DB_NAME}
  229. - WARTHOG_STARTER_DB_HOST=db
  230. - WARTHOG_STARTER_DB_PASSWORD=${DB_PASS}
  231. - WARTHOG_STARTER_DB_PORT=${DB_PORT}
  232. - WARTHOG_STARTER_DB_USERNAME=${DB_USER}
  233. - WARTHOG_STARTER_REDIS_URI=redis://redis:6379/0
  234. - WARTHOG_APP_PORT=${HYDRA_INDEXER_GATEWAY_PORT}
  235. - PORT=${HYDRA_INDEXER_GATEWAY_PORT}
  236. - DEBUG=*
  237. ports:
  238. - "${HYDRA_INDEXER_GATEWAY_PORT}:${HYDRA_INDEXER_GATEWAY_PORT}"
  239. depends_on:
  240. - db
  241. - redis
  242. redis:
  243. image: redis:6.0-alpine
  244. container_name: redis
  245. restart: unless-stopped
  246. ports:
  247. - "127.0.0.1:6379:6379"
  248. pioneer:
  249. image: nginx
  250. container_name: pioneer
  251. restart: unless-stopped
  252. volumes:
  253. - ./pioneer/packages/apps/build:/usr/share/nginx/html
  254. ports:
  255. - "3000:80"
  256. environment:
  257. - NGINX_PORT=80
  258. faucet:
  259. image: joystream/faucet:giza
  260. restart: on-failure
  261. container_name: faucet
  262. environment:
  263. - SCREENING_AUTHORITY_SEED=//Alice
  264. - PORT=3002
  265. - PROVIDER=ws://joystream-node:9944
  266. - ENDOWMENT=0
  267. ports:
  268. - "3002:3002"
  269. orion:
  270. container_name: orion
  271. image: joystream/orion
  272. environment:
  273. - ORION_PORT=6116
  274. - ORION_MONGO_HOSTNAME=mongo
  275. - ORION_FEATURED_CONTENT_SECRET=password123
  276. - ORION_QUERY_NODE_URL=http://graphql-server:${GRAPHQL_SERVER_PORT}/graphql
  277. ports:
  278. - "6116:6116"
  279. depends_on:
  280. - mongo
  281. restart: always
  282. mongo:
  283. restart: always
  284. container_name: mongo
  285. image: library/mongo:4.4
  286. volumes:
  287. - orion-mongo-data:/data/db
  288. volumes:
  289. chain-data:
  290. driver: local
  291. query-node-data:
  292. driver: local
  293. colossus-1-data:
  294. driver: local
  295. colossus-1-keystore:
  296. driver: local
  297. colossus-1-logs:
  298. driver: local
  299. colossus-2-data:
  300. driver: local
  301. colossus-2-keystore:
  302. driver: local
  303. colossus-2-logs:
  304. driver: local
  305. distributor-1-logs:
  306. driver: local
  307. distributor-1-cache:
  308. driver: local
  309. distributor-1-data:
  310. driver: local
  311. distributor-2-logs:
  312. driver: local
  313. distributor-2-cache:
  314. driver: local
  315. distributor-2-data:
  316. driver: local
  317. orion-mongo-data:
  318. driver: local