docker-compose.yml 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  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:$JOYSTREAM_NODE_TAG
  8. restart: unless-stopped
  9. build:
  10. # context is relative to the compose file
  11. context: .
  12. # dockerfile is relative to the context
  13. dockerfile: joystream-node.Dockerfile
  14. container_name: joystream-node
  15. volumes:
  16. - chain-data:/data
  17. command: --dev --alice --validator --unsafe-ws-external --unsafe-rpc-external --rpc-methods Safe --rpc-cors=all --log runtime --base-path /data
  18. ports:
  19. - 9944:9944
  20. - 9933:9933
  21. colossus-1:
  22. image: node:14
  23. container_name: colossus-1
  24. restart: on-failure
  25. volumes:
  26. - colossus-1-data:/data
  27. - colossus-1-keystore:/keystore
  28. - type: bind
  29. source: .
  30. target: /joystream
  31. working_dir: /joystream/storage-node-v2
  32. ports:
  33. - 3333:3333
  34. env_file:
  35. # relative to working directory where docker-compose was run from
  36. - .env
  37. environment:
  38. # ACCOUNT_URI overrides command line arg --accountUri
  39. - ACCOUNT_URI=${COLOSSUS_1_TRANSACTOR_URI}
  40. command: [
  41. 'yarn', 'storage-node', 'server', '--worker=${COLOSSUS_1_WORKER_ID}', '--port=3333', '--uploads=/data',
  42. '--sync', '--syncInterval=1',
  43. '--queryNodeEndpoint=${COLOSSUS_QUERY_NODE_URL}',
  44. '--apiUrl=${JOYSTREAM_NODE_WS}'
  45. ]
  46. distributor-1:
  47. image: node:14
  48. container_name: distributor-1
  49. restart: on-failure
  50. volumes:
  51. - distributor-1-data:/data
  52. - distributor-1-cache:/cache
  53. - distributor-1-logs:/logs
  54. - type: bind
  55. source: .
  56. target: /joystream
  57. # let the working_dir be the distributor node to pickup the config.yml file
  58. working_dir: /joystream/distributor-node
  59. ports:
  60. - 3334:3334
  61. - 127.0.0.1:4334:4334
  62. env_file:
  63. # relative to working directory where docker-compose was run from
  64. - .env
  65. # Node configuration can be overriden via env, for exampe:
  66. environment:
  67. JOYSTREAM_DISTRIBUTOR__ID: distributor-1
  68. JOYSTREAM_DISTRIBUTOR__ENDPOINTS__QUERY_NODE: ${DISTRIBUTOR_QUERY_NODE_URL}
  69. JOYSTREAM_DISTRIBUTOR__KEYS: "[{\"suri\":\"${DISTRIBUTOR_1_ACCOUNT_URI}\"}]"
  70. JOYSTREAM_DISTRIBUTOR__WORKER_ID: ${DISTRIBUTOR_1_WORKER_ID}
  71. JOYSTREAM_DISTRIBUTOR__PUBLIC_API__PORT: 3334
  72. JOYSTREAM_DISTRIBUTOR__OPERATOR_API__PORT: 4334
  73. JOYSTREAM_DISTRIBUTOR__ENDPOINTS__JOYSTREAM_NODE_WS: ${JOYSTREAM_NODE_WS}
  74. JOYSTREAM_DISTRIBUTOR__DIRECTORIES__ASSETS: /data
  75. JOYSTREAM_DISTRIBUTOR__DIRECTORIES__CACHE_STATE: /cache
  76. JOYSTREAM_DISTRIBUTOR__LOGS__FILE__PATH: /logs
  77. # JOYSTREAM_DISTRIBUTOR__ENDPOINTS__ELASTIC_SEARCH: es-endpoint
  78. # JOYSTREAM_DISTRIBUTOR__LOGS__CONSOLE: "off"
  79. # JOYSTREAM_DISTRIBUTOR__LOGS__FILE: "off"
  80. # JOYSTREAM_DISTRIBUTOR__LOGS__ELASTIC: "off"
  81. # JOYSTREAM_DISTRIBUTOR__LIMITS__STORAGE: 50G
  82. # JOYSTREAM_DISTRIBUTOR__BUCKETS: "[\"1:0\",\"1:1\"]"
  83. command: ['yarn', 'joystream-distributor', 'start']
  84. colossus-2:
  85. image: node:14
  86. container_name: colossus-2
  87. restart: on-failure
  88. volumes:
  89. - colossus-2-data:/data
  90. - colossus-2-keystore:/keystore
  91. - type: bind
  92. source: .
  93. target: /joystream
  94. working_dir: /joystream/storage-node-v2
  95. ports:
  96. - 3335:3333
  97. env_file:
  98. # relative to working directory where docker-compose was run from
  99. - .env
  100. environment:
  101. # ACCOUNT_URI overrides command line arg --accountUri
  102. - ACCOUNT_URI=${COLOSSUS_2_TRANSACTOR_URI}
  103. command: [
  104. 'yarn', 'storage-node', 'server', '--worker=${COLOSSUS_2_WORKER_ID}', '--port=3333', '--uploads=/data',
  105. '--sync', '--syncInterval=1',
  106. '--queryNodeEndpoint=${COLOSSUS_QUERY_NODE_URL}',
  107. '--apiUrl=${JOYSTREAM_NODE_WS}'
  108. ]
  109. distributor-2:
  110. image: node:14
  111. container_name: distributor-2
  112. restart: on-failure
  113. volumes:
  114. - distributor-2-data:/data
  115. - distributor-2-cache:/cache
  116. - distributor-2-logs:/logs
  117. - type: bind
  118. source: .
  119. target: /joystream
  120. # let the working_dir be the distributor node to pickup the config.yml file
  121. working_dir: /joystream/distributor-node
  122. ports:
  123. - 3336:3334
  124. - 127.0.0.1:4336:4334
  125. env_file:
  126. # relative to working directory where docker-compose was run from
  127. - .env
  128. # Node configuration can be overriden via env, for exampe:
  129. environment:
  130. JOYSTREAM_DISTRIBUTOR__ID: distributor-2
  131. JOYSTREAM_DISTRIBUTOR__ENDPOINTS__QUERY_NODE: ${DISTRIBUTOR_QUERY_NODE_URL}
  132. JOYSTREAM_DISTRIBUTOR__KEYS: "[{\"suri\":\"${DISTRIBUTOR_2_ACCOUNT_URI}\"}]"
  133. JOYSTREAM_DISTRIBUTOR__WORKER_ID: ${DISTRIBUTOR_2_WORKER_ID}
  134. JOYSTREAM_DISTRIBUTOR__PUBLIC_API__PORT: 3334
  135. JOYSTREAM_DISTRIBUTOR__OPERATOR_API__PORT: 4334
  136. JOYSTREAM_DISTRIBUTOR__ENDPOINTS__JOYSTREAM_NODE_WS: ${JOYSTREAM_NODE_WS}
  137. JOYSTREAM_DISTRIBUTOR__DIRECTORIES__ASSETS: /data
  138. JOYSTREAM_DISTRIBUTOR__DIRECTORIES__CACHE_STATE: /cache
  139. JOYSTREAM_DISTRIBUTOR__LOGS__FILE__PATH: /logs
  140. # JOYSTREAM_DISTRIBUTOR__ENDPOINTS__ELASTIC_SEARCH: es-endpoint
  141. # JOYSTREAM_DISTRIBUTOR__LOGS__CONSOLE: "off"
  142. # JOYSTREAM_DISTRIBUTOR__LOGS__FILE: "off"
  143. # JOYSTREAM_DISTRIBUTOR__LOGS__ELASTIC: "off"
  144. # JOYSTREAM_DISTRIBUTOR__LIMITS__STORAGE: 50G
  145. # JOYSTREAM_DISTRIBUTOR__BUCKETS: "[\"1:0\",\"1:1\"]"
  146. command: ['yarn', 'joystream-distributor', 'start']
  147. db:
  148. image: postgres:12
  149. container_name: db
  150. restart: unless-stopped
  151. ports:
  152. - '127.0.0.1:${DB_PORT}:${DB_PORT}'
  153. volumes:
  154. - query-node-data:/var/lib/postgresql/data
  155. env_file:
  156. # relative to working directory where docker-compose was run from
  157. - .env
  158. environment:
  159. POSTGRES_USER: ${DB_USER}
  160. POSTGRES_PASSWORD: ${DB_PASS}
  161. POSTGRES_DB: ${INDEXER_DB_NAME}
  162. PGPORT: ${DB_PORT}
  163. graphql-server:
  164. image: node:14
  165. container_name: graphql-server
  166. restart: unless-stopped
  167. env_file:
  168. # relative to working directory where docker-compose was run from
  169. - .env
  170. environment:
  171. - DB_HOST=db
  172. - WARTHOG_APP_PORT=${GRAPHQL_SERVER_PORT}
  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. pioneer:
  252. image: nginx
  253. container_name: pioneer
  254. restart: unless-stopped
  255. volumes:
  256. - ./pioneer/packages/apps/build:/usr/share/nginx/html
  257. ports:
  258. - "3000:80"
  259. environment:
  260. - NGINX_PORT=80
  261. faucet:
  262. image: joystream/faucet:giza
  263. restart: on-failure
  264. container_name: faucet
  265. environment:
  266. - SCREENING_AUTHORITY_SEED=//Alice
  267. - PORT=3002
  268. - PROVIDER=ws://joystream-node:9944
  269. - ENDOWMENT=0
  270. ports:
  271. - "3002:3002"
  272. orion:
  273. container_name: orion
  274. image: joystream/orion
  275. environment:
  276. - ORION_PORT=6116
  277. - ORION_MONGO_HOSTNAME=mongo
  278. - ORION_FEATURED_CONTENT_SECRET=password123
  279. - ORION_QUERY_NODE_URL=http://graphql-server:${GRAPHQL_SERVER_PORT}/graphql
  280. ports:
  281. - "6116:6116"
  282. depends_on:
  283. - mongo
  284. restart: always
  285. mongo:
  286. restart: always
  287. container_name: mongo
  288. image: library/mongo:4.4
  289. volumes:
  290. - orion-mongo-data:/data/db
  291. volumes:
  292. chain-data:
  293. driver: local
  294. query-node-data:
  295. driver: local
  296. colossus-1-data:
  297. driver: local
  298. colossus-1-keystore:
  299. driver: local
  300. colossus-2-data:
  301. driver: local
  302. colossus-2-keystore:
  303. driver: local
  304. distributor-1-logs:
  305. driver: local
  306. distributor-1-cache:
  307. driver: local
  308. distributor-1-data:
  309. driver: local
  310. distributor-2-logs:
  311. driver: local
  312. distributor-2-cache:
  313. driver: local
  314. distributor-2-data:
  315. driver: local
  316. orion-mongo-data:
  317. driver: local