docker-compose.yml 5.5 KB

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