docker-compose.yml 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327
  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 Unsafe --rpc-cors=all --log runtime --base-path /data
  18. ports:
  19. - '127.0.0.1:9944:9944'
  20. - '127.0.0.1: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. - '127.0.0.1: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_ACCOUNT_URI}
  40. command: [
  41. 'yarn', 'storage-node', 'server', '--worker=${COLOSSUS_1_WORKER_ID}', '--port=3333', '--uploads=/data',
  42. '--sync', '--syncInterval=1',
  43. '--queryNodeHost=${COLOSSUS_QUERY_NODE_HOST}',
  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. - 127.0.0.1:3334:3334
  61. env_file:
  62. # relative to working directory where docker-compose was run from
  63. - .env
  64. # Node configuration can be overriden via env, for exampe:
  65. environment:
  66. JOYSTREAM_DISTRIBUTOR__ID: distributor-1
  67. JOYSTREAM_DISTRIBUTOR__ENDPOINTS__QUERY_NODE: ${DISTRIBUTOR_QUERY_NODE_URL}
  68. JOYSTREAM_DISTRIBUTOR__KEYS: "[{\"suri\":\"${DISTRIBUTOR_1_ACCOUNT_URI}\"}]"
  69. JOYSTREAM_DISTRIBUTOR__WORKER_ID: ${DISTRIBUTOR_1_WORKER_ID}
  70. JOYSTREAM_DISTRIBUTOR__PORT: 3334
  71. JOYSTREAM_DISTRIBUTOR__ENDPOINTS__JOYSTREAM_NODE_WS: ${JOYSTREAM_NODE_WS}
  72. JOYSTREAM_DISTRIBUTOR__DIRECTORIES__ASSETS: /data
  73. JOYSTREAM_DISTRIBUTOR__DIRECTORIES__CACHE_STATE: /cache
  74. JOYSTREAM_DISTRIBUTOR__DIRECTORIES__LOGS: /logs
  75. # JOYSTREAM_DISTRIBUTOR__ENDPOINTS__ELASTIC_SEARCH: es-endpoint
  76. # JOYSTREAM_DISTRIBUTOR__LOG__CONSOLE: "off"
  77. # JOYSTREAM_DISTRIBUTOR__LOG__FILE: "off"
  78. # JOYSTREAM_DISTRIBUTOR__LOG__ELASTIC: "off"
  79. # JOYSTREAM_DISTRIBUTOR__LIMITS__STORAGE: 50G
  80. # JOYSTREAM_DISTRIBUTOR__BUCKETS: "[1,2]"
  81. command: ['yarn', 'joystream-distributor', 'start']
  82. colossus-2:
  83. image: node:14
  84. container_name: colossus-2
  85. restart: on-failure
  86. volumes:
  87. - colossus-2-data:/data
  88. - colossus-2-keystore:/keystore
  89. - type: bind
  90. source: .
  91. target: /joystream
  92. working_dir: /joystream/storage-node-v2
  93. ports:
  94. - '127.0.0.1:3335:3333'
  95. env_file:
  96. # relative to working directory where docker-compose was run from
  97. - .env
  98. environment:
  99. # ACCOUNT_URI overrides command line arg --accountUri
  100. - ACCOUNT_URI=${COLOSSUS_2_ACCOUNT_URI}
  101. command: [
  102. 'yarn', 'storage-node', 'server', '--worker=${COLOSSUS_2_WORKER_ID}', '--port=3333', '--uploads=/data',
  103. '--sync', '--syncInterval=1',
  104. '--queryNodeHost=${COLOSSUS_QUERY_NODE_HOST}',
  105. '--apiUrl=${JOYSTREAM_NODE_WS}'
  106. ]
  107. distributor-2:
  108. image: node:14
  109. container_name: distributor-2
  110. restart: on-failure
  111. volumes:
  112. - distributor-2-data:/data
  113. - distributor-2-cache:/cache
  114. - distributor-2-logs:/logs
  115. - type: bind
  116. source: .
  117. target: /joystream
  118. # let the working_dir be the distributor node to pickup the config.yml file
  119. working_dir: /joystream/distributor-node
  120. ports:
  121. - 127.0.0.1:3336:3334
  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__PORT: 3334
  132. JOYSTREAM_DISTRIBUTOR__ENDPOINTS__JOYSTREAM_NODE_WS: ${JOYSTREAM_NODE_WS}
  133. JOYSTREAM_DISTRIBUTOR__DIRECTORIES__ASSETS: /data
  134. JOYSTREAM_DISTRIBUTOR__DIRECTORIES__CACHE_STATE: /cache
  135. JOYSTREAM_DISTRIBUTOR__DIRECTORIES__LOGS: /logs
  136. # JOYSTREAM_DISTRIBUTOR__ENDPOINTS__ELASTIC_SEARCH: es-endpoint
  137. # JOYSTREAM_DISTRIBUTOR__LOG__CONSOLE: "off"
  138. # JOYSTREAM_DISTRIBUTOR__LOG__FILE: "off"
  139. # JOYSTREAM_DISTRIBUTOR__LOG__ELASTIC: "off"
  140. # JOYSTREAM_DISTRIBUTOR__LIMITS__STORAGE: 50G
  141. # JOYSTREAM_DISTRIBUTOR__BUCKETS: "[1,2]"
  142. command: ['yarn', 'joystream-distributor', 'start']
  143. db:
  144. image: postgres:12
  145. container_name: db
  146. restart: unless-stopped
  147. ports:
  148. - '127.0.0.1:${DB_PORT}:${DB_PORT}'
  149. volumes:
  150. - query-node-data:/var/lib/postgresql/data
  151. env_file:
  152. # relative to working directory where docker-compose was run from
  153. - .env
  154. environment:
  155. POSTGRES_USER: ${DB_USER}
  156. POSTGRES_PASSWORD: ${DB_PASS}
  157. POSTGRES_DB: ${INDEXER_DB_NAME}
  158. PGPORT: ${DB_PORT}
  159. graphql-server:
  160. image: node:14
  161. container_name: graphql-server
  162. restart: unless-stopped
  163. env_file:
  164. # relative to working directory where docker-compose was run from
  165. - .env
  166. environment:
  167. - DB_HOST=db
  168. - WARTHOG_APP_PORT=${GRAPHQL_SERVER_PORT}
  169. ports:
  170. - '127.0.0.1:${GRAPHQL_SERVER_PORT}:${GRAPHQL_SERVER_PORT}'
  171. depends_on:
  172. - db
  173. volumes:
  174. - type: bind
  175. source: .
  176. target: /joystream
  177. working_dir: /joystream
  178. command: ['yarn', 'workspace', 'query-node-root', 'query-node:start:prod']
  179. processor:
  180. image: node:14
  181. container_name: processor
  182. restart: unless-stopped
  183. env_file:
  184. # relative to working directory where docker-compose was run from
  185. - .env
  186. environment:
  187. - INDEXER_ENDPOINT_URL=${PROCESSOR_INDEXER_GATEWAY}
  188. - TYPEORM_HOST=db
  189. - TYPEORM_DATABASE=${DB_NAME}
  190. depends_on:
  191. - db
  192. volumes:
  193. - type: bind
  194. source: .
  195. target: /joystream
  196. working_dir: /joystream
  197. command: ['yarn', 'workspace', 'query-node-root', 'processor:start']
  198. indexer:
  199. image: joystream/hydra-indexer:3.0.0
  200. container_name: indexer
  201. restart: unless-stopped
  202. env_file:
  203. # relative to working directory where docker-compose was run from
  204. - .env
  205. environment:
  206. - DB_NAME=${INDEXER_DB_NAME}
  207. - INDEXER_WORKERS=5
  208. - REDIS_URI=redis://redis:6379/0
  209. - TYPES_JSON=types.json
  210. - WS_PROVIDER_ENDPOINT_URI=${JOYSTREAM_NODE_WS}
  211. - DB_HOST=db
  212. depends_on:
  213. - db
  214. - redis
  215. volumes:
  216. - ./types/augment/all/defs.json:/home/hydra/packages/hydra-indexer/types.json
  217. command: >
  218. sh -c "yarn db:bootstrap && yarn start:prod"
  219. hydra-indexer-gateway:
  220. image: joystream/hydra-indexer-gateway:3.0.0
  221. container_name: hydra-indexer-gateway
  222. restart: unless-stopped
  223. env_file:
  224. # relative to working directory where docker-compose was run from
  225. - .env
  226. environment:
  227. - WARTHOG_STARTER_DB_DATABASE=${INDEXER_DB_NAME}
  228. - WARTHOG_STARTER_DB_HOST=db
  229. - WARTHOG_STARTER_DB_PASSWORD=${DB_PASS}
  230. - WARTHOG_STARTER_DB_PORT=${DB_PORT}
  231. - WARTHOG_STARTER_DB_USERNAME=${DB_USER}
  232. - WARTHOG_STARTER_REDIS_URI=redis://redis:6379/0
  233. - WARTHOG_APP_PORT=${HYDRA_INDEXER_GATEWAY_PORT}
  234. - PORT=${HYDRA_INDEXER_GATEWAY_PORT}
  235. - DEBUG=*
  236. ports:
  237. - '127.0.0.1:${HYDRA_INDEXER_GATEWAY_PORT}:${HYDRA_INDEXER_GATEWAY_PORT}'
  238. depends_on:
  239. - db
  240. - redis
  241. redis:
  242. image: redis:6.0-alpine
  243. container_name: redis
  244. restart: unless-stopped
  245. ports:
  246. - '127.0.0.1:6379:6379'
  247. pioneer:
  248. image: nginx
  249. container_name: pioneer
  250. restart: unless-stopped
  251. volumes:
  252. - ./pioneer/packages/apps/build:/usr/share/nginx/html
  253. ports:
  254. - "127.0.0.1:3000:80"
  255. environment:
  256. - NGINX_PORT=80
  257. faucet:
  258. image: joystream/faucet:giza
  259. restart: on-failure
  260. container_name: faucet
  261. environment:
  262. - SCREENING_AUTHORITY_SEED=//Alice
  263. - PORT=3002
  264. - PROVIDER=ws://joystream-node:9944
  265. - ENDOWMENT=0
  266. ports:
  267. - "127.0.0.1:3002:3002"
  268. orion:
  269. container_name: orion
  270. image: joystream/orion
  271. environment:
  272. - ORION_PORT=6116
  273. - ORION_MONGO_HOSTNAME=mongo
  274. - ORION_FEATURED_CONTENT_SECRET=password123
  275. ports:
  276. - "6116:6116"
  277. depends_on:
  278. - mongo
  279. restart: always
  280. mongo:
  281. restart: always
  282. container_name: mongo
  283. image: library/mongo:4.4
  284. volumes:
  285. - orion-mongo-data:/data/db
  286. volumes:
  287. chain-data:
  288. driver: local
  289. query-node-data:
  290. driver: local
  291. colossus-1-data:
  292. driver: local
  293. colossus-1-keystore:
  294. driver: local
  295. colossus-2-data:
  296. driver: local
  297. colossus-2-keystore:
  298. driver: local
  299. distributor-1-logs:
  300. driver: local
  301. distributor-1-cache:
  302. driver: local
  303. distributor-1-data:
  304. driver: local
  305. distributor-2-logs:
  306. driver: local
  307. distributor-2-cache:
  308. driver: local
  309. distributor-2-data:
  310. driver: local
  311. orion-mongo-data:
  312. driver: local