docker-compose.yml 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  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:
  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. processor:
  85. image: joystream/apps
  86. restart: unless-stopped
  87. build:
  88. context: .
  89. dockerfile: apps.Dockerfile
  90. env_file:
  91. # relative to working directory where docker-compose was run from
  92. - .env
  93. environment:
  94. - INDEXER_ENDPOINT_URL=http://hydra-indexer-gateway:${WARTHOG_APP_PORT}/graphql
  95. - TYPEORM_HOST=db
  96. - TYPEORM_DATABASE=${DB_NAME}
  97. - DEBUG=index-builder:*
  98. - PROCESSOR_POLL_INTERVAL=1000 # refresh every second
  99. volumes:
  100. - ./types/augment/all/defs.json:/joystream/query-node/mappings/lib/generated/types/typedefs.json
  101. depends_on:
  102. - graphql-server
  103. - hydra-indexer-gateway
  104. command: ["workspace", "query-node-root", "processor:start"]
  105. indexer:
  106. image: joystream/hydra-indexer:2.1.0-beta.9
  107. restart: unless-stopped
  108. env_file:
  109. # relative to working directory where docker-compose was run from
  110. - .env
  111. environment:
  112. - DB_HOST=db
  113. - DB_NAME=${INDEXER_DB_NAME}
  114. - INDEXER_WORKERS=5
  115. - REDIS_URI=redis://redis:6379/0
  116. - DEBUG=index-builder:*
  117. - WS_PROVIDER_ENDPOINT_URI=${WS_PROVIDER_ENDPOINT_URI}
  118. - TYPES_JSON=types.json
  119. depends_on:
  120. - db
  121. - redis
  122. volumes:
  123. - ./types/augment/all/defs.json:/home/hydra/packages/hydra-indexer/types.json
  124. command: >
  125. sh -c "yarn db:bootstrap && yarn start:prod"
  126. hydra-indexer-gateway:
  127. image: joystream/hydra-indexer-gateway:2.1.0-beta.5
  128. restart: unless-stopped
  129. env_file:
  130. # relative to working directory where docker-compose was run from
  131. - .env
  132. environment:
  133. - WARTHOG_STARTER_DB_DATABASE=${INDEXER_DB_NAME}
  134. - WARTHOG_STARTER_DB_HOST=db
  135. - WARTHOG_STARTER_DB_PASSWORD=${DB_PASS}
  136. - WARTHOG_STARTER_DB_PORT=${DB_PORT}
  137. - WARTHOG_STARTER_DB_USERNAME=${DB_USER}
  138. - WARTHOG_STARTER_REDIS_URI=redis://redis:6379/0
  139. - WARTHOG_APP_PORT=${WARTHOG_APP_PORT}
  140. - PORT=${WARTHOG_APP_PORT}
  141. - DEBUG=*
  142. ports:
  143. - "127.0.0.1:4000:4002"
  144. depends_on:
  145. - redis
  146. - db
  147. - indexer
  148. redis:
  149. image: redis:6.0-alpine
  150. restart: always
  151. ports:
  152. - "127.0.0.1:6379:6379"
  153. pioneer:
  154. image: joystream/pioneer
  155. build:
  156. context: .
  157. dockerfile: pioneer.Dockerfile
  158. ports:
  159. - "127.0.0.1:3000:80"