docker-compose.yml 5.0 KB

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