docker-compose.yml 5.2 KB

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