docker-compose.yml 10 KB

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