docker-compose.yml 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  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. ipfs:
  21. image: ipfs/go-ipfs:latest
  22. ports:
  23. - '127.0.0.1:5001:5001'
  24. - '127.0.0.1:8080:8080'
  25. volumes:
  26. - /data/ipfs
  27. entrypoint: ''
  28. command: |
  29. /bin/sh -c "
  30. set -e
  31. /usr/local/bin/start_ipfs config profile apply lowpower
  32. /usr/local/bin/start_ipfs config --json Gateway.PublicGateways '{\"localhost\": null }'
  33. /sbin/tini -- /usr/local/bin/start_ipfs daemon --migrate=true
  34. "
  35. colossus:
  36. image: joystream/apps
  37. restart: on-failure
  38. depends_on:
  39. - "ipfs"
  40. build:
  41. context: .
  42. dockerfile: apps.Dockerfile
  43. env_file:
  44. # relative to working directory where docker-compose was run from
  45. - .env
  46. ports:
  47. - '127.0.0.1:3001:3001'
  48. command: colossus --dev --ws-provider ${WS_PROVIDER_ENDPOINT_URI} --ipfs-host ipfs
  49. environment:
  50. - DEBUG=*
  51. db:
  52. image: postgres:12
  53. restart: always
  54. ports:
  55. - "127.0.0.1:${DB_PORT}:5432"
  56. volumes:
  57. - /var/lib/postgresql/data
  58. env_file:
  59. # relative to working directory where docker-compose was run from
  60. - .env
  61. environment:
  62. POSTGRES_USER: ${DB_USER}
  63. POSTGRES_PASSWORD: ${DB_PASS}
  64. POSTGRES_DB: ${INDEXER_DB_NAME}
  65. graphql-server:
  66. image: joystream/apps
  67. restart: unless-stopped
  68. build:
  69. context: .
  70. dockerfile: apps.Dockerfile
  71. network: joystream_default
  72. args:
  73. - WS_PROVIDER_ENDPOINT_URI=${WS_PROVIDER_ENDPOINT_URI}
  74. env_file:
  75. # relative to working directory where docker-compose was run from
  76. - .env
  77. ports:
  78. - "127.0.0.1:8081:${GRAPHQL_SERVER_PORT}"
  79. depends_on:
  80. - db
  81. command: ["workspace", "query-node-root", "query-node:start:prod"]
  82. graphql-server-mnt:
  83. image: node:14
  84. restart: unless-stopped
  85. env_file:
  86. # relative to working directory where docker-compose was run from
  87. - .env
  88. ports:
  89. - "127.0.0.1:8081:${GRAPHQL_SERVER_PORT}"
  90. depends_on:
  91. - db
  92. volumes:
  93. - type: bind
  94. source: .
  95. target: /joystream
  96. working_dir: /joystream
  97. command: ["yarn", "workspace", "query-node-root", "query-node:start:prod"]
  98. processor:
  99. image: joystream/apps
  100. restart: unless-stopped
  101. build:
  102. context: .
  103. dockerfile: apps.Dockerfile
  104. network: joystream_default
  105. args:
  106. - WS_PROVIDER_ENDPOINT_URI=${WS_PROVIDER_ENDPOINT_URI}
  107. env_file:
  108. # relative to working directory where docker-compose was run from
  109. - .env
  110. environment:
  111. - INDEXER_ENDPOINT_URL=http://hydra-indexer-gateway:${WARTHOG_APP_PORT}/graphql
  112. - TYPEORM_HOST=${DB_HOST}
  113. - TYPEORM_DATABASE=${DB_NAME}
  114. - WS_PROVIDER_ENDPOINT_URI=${WS_PROVIDER_ENDPOINT_URI}
  115. volumes:
  116. - ./types/augment/all/defs.json:/joystream/query-node/mappings/lib/generated/types/typedefs.json
  117. depends_on:
  118. - hydra-indexer-gateway
  119. command: ["workspace", "query-node-root", "processor:start"]
  120. processor-mnt:
  121. image: node:14
  122. restart: unless-stopped
  123. env_file:
  124. # relative to working directory where docker-compose was run from
  125. - .env
  126. environment:
  127. - INDEXER_ENDPOINT_URL=http://hydra-indexer-gateway:${WARTHOG_APP_PORT}/graphql
  128. - TYPEORM_HOST=${DB_HOST}
  129. - TYPEORM_DATABASE=${DB_NAME}
  130. depends_on:
  131. - hydra-indexer-gateway
  132. volumes:
  133. - type: bind
  134. source: .
  135. target: /joystream
  136. working_dir: /joystream
  137. command: ["yarn", "workspace", "query-node-root", "processor:start"]
  138. indexer:
  139. image: joystream/hydra-indexer:3.0.0
  140. restart: unless-stopped
  141. env_file:
  142. # relative to working directory where docker-compose was run from
  143. - .env
  144. environment:
  145. - DB_NAME=${INDEXER_DB_NAME}
  146. - INDEXER_WORKERS=5
  147. - REDIS_URI=redis://redis:6379/0
  148. - TYPES_JSON=types.json
  149. depends_on:
  150. - db
  151. - redis
  152. volumes:
  153. - ./types/augment/all/defs.json:/home/hydra/packages/hydra-indexer/types.json
  154. command: >
  155. sh -c "yarn db:bootstrap && yarn start:prod"
  156. hydra-indexer-gateway:
  157. image: joystream/hydra-indexer-gateway:3.0.0
  158. restart: unless-stopped
  159. env_file:
  160. # relative to working directory where docker-compose was run from
  161. - .env
  162. environment:
  163. - WARTHOG_STARTER_DB_DATABASE=${INDEXER_DB_NAME}
  164. - WARTHOG_STARTER_DB_HOST=db
  165. - WARTHOG_STARTER_DB_PASSWORD=${DB_PASS}
  166. - WARTHOG_STARTER_DB_PORT=${DB_PORT}
  167. - WARTHOG_STARTER_DB_USERNAME=${DB_USER}
  168. - WARTHOG_STARTER_REDIS_URI=redis://redis:6379/0
  169. - WARTHOG_APP_PORT=${WARTHOG_APP_PORT}
  170. - PORT=${WARTHOG_APP_PORT}
  171. - DEBUG=*
  172. ports:
  173. - "127.0.0.1:4000:${WARTHOG_APP_PORT}"
  174. depends_on:
  175. - redis
  176. - db
  177. - indexer
  178. redis:
  179. image: redis:6.0-alpine
  180. restart: always
  181. ports:
  182. - "127.0.0.1:6379:6379"
  183. pioneer:
  184. image: joystream/pioneer
  185. build:
  186. context: .
  187. dockerfile: pioneer.Dockerfile
  188. ports:
  189. - "127.0.0.1:3000:80"