docker-compose.yml 5.2 KB

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