docker-compose.yml 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  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:latest
  8. build:
  9. # context is relative to the compose file
  10. context: .
  11. # dockerfile is relative to the context
  12. dockerfile: joystream-node.Dockerfile
  13. container_name: joystream-node
  14. volumes:
  15. - /data
  16. command: --dev --alice --validator --unsafe-ws-external --unsafe-rpc-external --rpc-methods Unsafe --rpc-cors=all --log runtime --base-path /data
  17. ports:
  18. - '127.0.0.1:9944:9944'
  19. - '127.0.0.1:9933:9933'
  20. colossus-1:
  21. image: node:14
  22. container_name: colossus-1
  23. restart: on-failure
  24. volumes:
  25. - /data
  26. - /keystore
  27. - type: bind
  28. source: .
  29. target: /joystream
  30. working_dir: /joystream/storage-node-v2
  31. ports:
  32. - '127.0.0.1:3333:3333'
  33. env_file:
  34. # relative to working directory where docker-compose was run from
  35. - .env
  36. environment:
  37. # ACCOUNT_URI overrides command line arg --accountUri
  38. - ACCOUNT_URI=//testing//worker//Storage//0
  39. command: [
  40. 'yarn', 'storage-node', 'server', '--worker=0', '--port=3333', '--uploads=/data',
  41. '--sync', '--syncInterval=1',
  42. '--queryNodeHost=graphql-server:${WARTHOG_APP_PORT}',
  43. '--apiUrl=ws://joystream-node:9944/'
  44. ]
  45. distributor-1:
  46. image: node:14
  47. container_name: distributor-1
  48. restart: on-failure
  49. volumes:
  50. - /data
  51. - /cache
  52. - /logs
  53. - type: bind
  54. source: .
  55. target: /joystream
  56. # let the working_dir be the distributor node to pickup the config.yml file
  57. working_dir: /joystream/distributor-node
  58. ports:
  59. - 127.0.0.1:3334:3334
  60. # Node configuration can be overriden via env, for exampe:
  61. environment:
  62. # JOYSTREAM_DISTRIBUTOR__ID: node-id
  63. JOYSTREAM_DISTRIBUTOR__ENDPOINTS__QUERY_NODE: http://graphql-server:${WARTHOG_APP_PORT}/graphql
  64. JOYSTREAM_DISTRIBUTOR__KEYS: "[{\"suri\":\"//testing//workers//Distribution//0\"}]"
  65. JOYSTREAM_DISTRIBUTOR__WORKER_ID: 0
  66. JOYSTREAM_DISTRIBUTOR__PORT: 3334
  67. JOYSTREAM_DISTRIBUTOR__ENDPOINTS__JOYSTREAM_NODE_WS: ws://joystream-node:9944/
  68. # JOYSTREAM_DISTRIBUTOR__ENDPOINTS__ELASTIC_SEARCH: es-endpoint
  69. # JOYSTREAM_DISTRIBUTOR__DIRECTORIES__ASSETS: assets-dir
  70. # JOYSTREAM_DISTRIBUTOR__DIRECTORIES__CACHE_STATE: cache-state-dir
  71. # JOYSTREAM_DISTRIBUTOR__DIRECTORIES__LOGS: logs-dir
  72. # JOYSTREAM_DISTRIBUTOR__LOG__CONSOLE: "off"
  73. # JOYSTREAM_DISTRIBUTOR__LOG__FILE: "off"
  74. # JOYSTREAM_DISTRIBUTOR__LOG__ELASTIC: "off"
  75. # JOYSTREAM_DISTRIBUTOR__LIMITS__STORAGE: 50G
  76. # JOYSTREAM_DISTRIBUTOR__BUCKETS: "[1,2]"
  77. command: ['yarn', 'joystream-distributor', 'start']
  78. colossus-2:
  79. image: node:14
  80. container_name: colossus-2
  81. restart: on-failure
  82. volumes:
  83. - /data
  84. - /keystore
  85. - type: bind
  86. source: .
  87. target: /joystream
  88. working_dir: /joystream/storage-node-v2
  89. ports:
  90. - '127.0.0.1:3335:3333'
  91. env_file:
  92. # relative to working directory where docker-compose was run from
  93. - .env
  94. environment:
  95. # ACCOUNT_URI overrides command line arg --accountUri
  96. - ACCOUNT_URI=//testing//worker//Storage//1
  97. command: [
  98. 'yarn', 'storage-node', 'server', '--worker=1', '--port=3333', '--uploads=/data',
  99. '--sync', '--syncInterval=1',
  100. '--queryNodeHost=graphql-server:${WARTHOG_APP_PORT}',
  101. '--apiUrl=ws://joystream-node:9944/'
  102. ]
  103. distributor-2:
  104. image: node:14
  105. container_name: distributor-2
  106. restart: on-failure
  107. volumes:
  108. - /data
  109. - /cache
  110. - /logs
  111. - type: bind
  112. source: .
  113. target: /joystream
  114. # let the working_dir be the distributor node to pickup the config.yml file
  115. working_dir: /joystream/distributor-node
  116. ports:
  117. - 127.0.0.1:3336:3334
  118. # Node configuration can be overriden via env, for exampe:
  119. environment:
  120. # JOYSTREAM_DISTRIBUTOR__ID: node-id
  121. JOYSTREAM_DISTRIBUTOR__ENDPOINTS__QUERY_NODE: http://graphql-server:${WARTHOG_APP_PORT}/graphql
  122. JOYSTREAM_DISTRIBUTOR__KEYS: "[{\"suri\":\"//testing//workers//Distribution//1\"}]"
  123. JOYSTREAM_DISTRIBUTOR__WORKER_ID: 1
  124. JOYSTREAM_DISTRIBUTOR__PORT: 3334
  125. JOYSTREAM_DISTRIBUTOR__ENDPOINTS__JOYSTREAM_NODE_WS: ws://joystream-node:9944/
  126. # JOYSTREAM_DISTRIBUTOR__ENDPOINTS__ELASTIC_SEARCH: es-endpoint
  127. # JOYSTREAM_DISTRIBUTOR__DIRECTORIES__ASSETS: assets-dir
  128. # JOYSTREAM_DISTRIBUTOR__DIRECTORIES__CACHE_STATE: cache-state-dir
  129. # JOYSTREAM_DISTRIBUTOR__DIRECTORIES__LOGS: logs-dir
  130. # JOYSTREAM_DISTRIBUTOR__LOG__CONSOLE: "off"
  131. # JOYSTREAM_DISTRIBUTOR__LOG__FILE: "off"
  132. # JOYSTREAM_DISTRIBUTOR__LOG__ELASTIC: "off"
  133. # JOYSTREAM_DISTRIBUTOR__LIMITS__STORAGE: 50G
  134. # JOYSTREAM_DISTRIBUTOR__BUCKETS: "[1,2]"
  135. command: ['yarn', 'joystream-distributor', 'start']
  136. db:
  137. image: postgres:12
  138. container_name: db
  139. restart: always
  140. ports:
  141. - '127.0.0.1:${DB_PORT}:5432'
  142. volumes:
  143. - /var/lib/postgresql/data
  144. env_file:
  145. # relative to working directory where docker-compose was run from
  146. - .env
  147. environment:
  148. POSTGRES_USER: ${DB_USER}
  149. POSTGRES_PASSWORD: ${DB_PASS}
  150. POSTGRES_DB: ${INDEXER_DB_NAME}
  151. graphql-server:
  152. image: node:14
  153. container_name: graphql-server
  154. restart: unless-stopped
  155. env_file:
  156. # relative to working directory where docker-compose was run from
  157. - .env
  158. ports:
  159. - '127.0.0.1:8081:${WARTHOG_APP_PORT}'
  160. depends_on:
  161. - db
  162. volumes:
  163. - type: bind
  164. source: .
  165. target: /joystream
  166. working_dir: /joystream
  167. command: ['yarn', 'workspace', 'query-node-root', 'query-node:start:prod']
  168. processor:
  169. image: node:14
  170. container_name: processor
  171. restart: unless-stopped
  172. env_file:
  173. # relative to working directory where docker-compose was run from
  174. - .env
  175. environment:
  176. - INDEXER_ENDPOINT_URL=http://hydra-indexer-gateway:${WARTHOG_APP_PORT}/graphql
  177. - TYPEORM_HOST=${DB_HOST}
  178. - TYPEORM_DATABASE=${DB_NAME}
  179. depends_on:
  180. - hydra-indexer-gateway
  181. volumes:
  182. - type: bind
  183. source: .
  184. target: /joystream
  185. working_dir: /joystream
  186. command: ['yarn', 'workspace', 'query-node-root', 'processor:start']
  187. indexer:
  188. image: joystream/hydra-indexer:3.0.0
  189. container_name: indexer
  190. restart: unless-stopped
  191. env_file:
  192. # relative to working directory where docker-compose was run from
  193. - .env
  194. environment:
  195. - DB_NAME=${INDEXER_DB_NAME}
  196. - INDEXER_WORKERS=5
  197. - REDIS_URI=redis://redis:6379/0
  198. - TYPES_JSON=types.json
  199. - WS_PROVIDER_ENDPOINT_URI=${INDEXER_WS_PROVIDER_ENDPOINT_URI}
  200. depends_on:
  201. - db
  202. - redis
  203. volumes:
  204. - ./types/augment/all/defs.json:/home/hydra/packages/hydra-indexer/types.json
  205. command: >
  206. sh -c "yarn db:bootstrap && yarn start:prod"
  207. hydra-indexer-gateway:
  208. image: joystream/hydra-indexer-gateway:3.0.0
  209. container_name: hydra-indexer-gateway
  210. restart: unless-stopped
  211. env_file:
  212. # relative to working directory where docker-compose was run from
  213. - .env
  214. environment:
  215. - WARTHOG_STARTER_DB_DATABASE=${INDEXER_DB_NAME}
  216. - WARTHOG_STARTER_DB_HOST=${DB_HOST}
  217. - WARTHOG_STARTER_DB_PASSWORD=${DB_PASS}
  218. - WARTHOG_STARTER_DB_PORT=${DB_PORT}
  219. - WARTHOG_STARTER_DB_USERNAME=${DB_USER}
  220. - WARTHOG_STARTER_REDIS_URI=redis://redis:6379/0
  221. - WARTHOG_APP_PORT=${WARTHOG_APP_PORT}
  222. - PORT=${WARTHOG_APP_PORT}
  223. - DEBUG=*
  224. ports:
  225. - '127.0.0.1:4000:${WARTHOG_APP_PORT}'
  226. depends_on:
  227. - redis
  228. - db
  229. - indexer
  230. redis:
  231. image: redis:6.0-alpine
  232. container_name: redis
  233. restart: always
  234. ports:
  235. - '127.0.0.1:6379:6379'
  236. pioneer:
  237. image: nginx
  238. container_name: pioneer
  239. volumes:
  240. - ./pioneer/packages/apps/build:/usr/share/nginx/html
  241. ports:
  242. - "127.0.0.1:3000:80"
  243. environment:
  244. - NGINX_PORT=80
  245. # Used to for building native npm packages that will work in the container
  246. # yarn cache folder isn't mounted so packages will be downloaded
  247. # yarn-build-packages:
  248. # image: node:14
  249. # restart: never
  250. # volumes:
  251. # - type: bind
  252. # source: .
  253. # target: /joystream
  254. # working_dir: /joystream
  255. # command: ['yarn', 'build:packages']