docker-compose.yml 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  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: node:14
  37. volumes:
  38. - type: bind
  39. source: .
  40. target: /joystream
  41. working_dir: /joystream
  42. restart: on-failure
  43. depends_on:
  44. - "joystream-node"
  45. - "ipfs"
  46. env_file:
  47. # relative to working directory where docker-compose was run from
  48. - .env
  49. environment:
  50. - WS_PROVIDER_ENDPOINT_URI=${WS_PROVIDER_ENDPOINT_URI}
  51. ports:
  52. - '127.0.0.1:3001:3001'
  53. command: yarn colossus --dev --ws-provider ${WS_PROVIDER_ENDPOINT_URI} --ipfs-host ipfs
  54. db:
  55. image: postgres:12
  56. restart: always
  57. ports:
  58. - "127.0.0.1:${DB_PORT}:5432"
  59. volumes:
  60. - /var/lib/postgresql/data
  61. env_file:
  62. # relative to working directory where docker-compose was run from
  63. - .env
  64. environment:
  65. POSTGRES_USER: ${DB_USER}
  66. POSTGRES_PASSWORD: ${DB_PASS}
  67. POSTGRES_DB: ${INDEXER_DB_NAME}
  68. graphql-server:
  69. image: node:14
  70. volumes:
  71. - type: bind
  72. source: .
  73. target: /joystream
  74. working_dir: /joystream
  75. restart: unless-stopped
  76. env_file:
  77. # relative to working directory where docker-compose was run from
  78. - .env
  79. environment:
  80. - DB_HOST=db
  81. - DB_NAME=${DB_NAME}
  82. ports:
  83. - "127.0.0.1:8081:${GRAPHQL_SERVER_PORT}"
  84. depends_on:
  85. - db
  86. command: ["yarn", "workspace", "query-node-root", "query-node:start:prod"]
  87. processor:
  88. image: node:14
  89. volumes:
  90. - type: bind
  91. source: .
  92. target: /joystream
  93. - ./types/augment/all/defs.json:/joystream/query-node/mappings/lib/generated/types/typedefs.json
  94. working_dir: /joystream
  95. restart: unless-stopped
  96. env_file:
  97. # relative to working directory where docker-compose was run from
  98. - .env
  99. environment:
  100. - INDEXER_ENDPOINT_URL=http://hydra-indexer-gateway:${WARTHOG_APP_PORT}/graphql
  101. - TYPEORM_HOST=db
  102. - TYPEORM_DATABASE=${DB_NAME}
  103. - DEBUG=index-builder:*
  104. - WS_PROVIDER_ENDPOINT_URI=ws://joystream-node:9944
  105. depends_on:
  106. - hydra-indexer-gateway
  107. command: ["yarn", "workspace", "query-node-root", "processor:start"]
  108. indexer:
  109. image: joystream/hydra-indexer:3.0.0
  110. restart: unless-stopped
  111. env_file:
  112. # relative to working directory where docker-compose was run from
  113. - .env
  114. environment:
  115. - DB_HOST=db
  116. - DB_NAME=${INDEXER_DB_NAME}
  117. - INDEXER_WORKERS=5
  118. - REDIS_URI=redis://redis:6379/0
  119. - DEBUG=index-builder:*
  120. - WS_PROVIDER_ENDPOINT_URI=${WS_PROVIDER_ENDPOINT_URI}
  121. - TYPES_JSON=types.json
  122. depends_on:
  123. - db
  124. - redis
  125. volumes:
  126. - ./types/augment/all/defs.json:/home/hydra/packages/hydra-indexer/types.json
  127. command: >
  128. sh -c "yarn db:bootstrap && yarn start:prod"
  129. hydra-indexer-gateway:
  130. image: joystream/hydra-indexer-gateway:3.0.0
  131. restart: unless-stopped
  132. env_file:
  133. # relative to working directory where docker-compose was run from
  134. - .env
  135. environment:
  136. - WARTHOG_STARTER_DB_DATABASE=${INDEXER_DB_NAME}
  137. - WARTHOG_STARTER_DB_HOST=db
  138. - WARTHOG_STARTER_DB_PASSWORD=${DB_PASS}
  139. - WARTHOG_STARTER_DB_PORT=${DB_PORT}
  140. - WARTHOG_STARTER_DB_USERNAME=${DB_USER}
  141. - WARTHOG_STARTER_REDIS_URI=redis://redis:6379/0
  142. - WARTHOG_APP_PORT=${WARTHOG_APP_PORT}
  143. - PORT=${WARTHOG_APP_PORT}
  144. - DEBUG=*
  145. ports:
  146. - "127.0.0.1:4000:4002"
  147. depends_on:
  148. - redis
  149. - db
  150. - indexer
  151. redis:
  152. image: redis:6.0-alpine
  153. restart: always
  154. ports:
  155. - "127.0.0.1:6379:6379"
  156. pioneer:
  157. image: joystream/pioneer
  158. build:
  159. context: .
  160. dockerfile: pioneer.Dockerfile
  161. ports:
  162. - "127.0.0.1:3000:80"