docker-compose.yml 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  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 --rpc-cors=all --log runtime --base-path /data
  17. ports:
  18. - "127.0.0.1:9944:9944"
  19. ipfs:
  20. image: ipfs/go-ipfs:latest
  21. ports:
  22. - '127.0.0.1:5001:5001'
  23. - '127.0.0.1:8080:8080'
  24. volumes:
  25. - /data/ipfs
  26. entrypoint: ''
  27. command: |
  28. /bin/sh -c "
  29. set -e
  30. /usr/local/bin/start_ipfs config profile apply lowpower
  31. /usr/local/bin/start_ipfs config --json Gateway.PublicGateways '{\"localhost\": null }'
  32. /sbin/tini -- /usr/local/bin/start_ipfs daemon --migrate=true
  33. "
  34. colossus:
  35. image: joystream/apps
  36. restart: on-failure
  37. depends_on:
  38. - "joystream-node"
  39. - "ipfs"
  40. build:
  41. context: .
  42. dockerfile: apps.Dockerfile
  43. ports:
  44. - '127.0.0.1:3001:3001'
  45. command: colossus --dev --ws-provider ws://joystream-node:9944 --ipfs-host ipfs
  46. environment:
  47. - DEBUG=*
  48. db:
  49. image: postgres:12
  50. restart: always
  51. ports:
  52. - "127.0.0.1:${DB_PORT}:5432"
  53. volumes:
  54. - /var/lib/postgresql/data
  55. env_file:
  56. # relative to working directory where docker-compose was run from
  57. - .env
  58. environment:
  59. POSTGRES_USER: ${DB_USER}
  60. POSTGRES_PASSWORD: ${DB_PASS}
  61. POSTGRES_DB: ${INDEXER_DB_NAME}
  62. graphql-server:
  63. image: joystream/apps
  64. restart: unless-stopped
  65. build:
  66. context: .
  67. dockerfile: apps.Dockerfile
  68. env_file:
  69. # relative to working directory where docker-compose was run from
  70. - .env
  71. environment:
  72. - DB_HOST=db
  73. - DB_NAME=${DB_NAME}
  74. ports:
  75. - "127.0.0.1:8081:${GRAPHQL_SERVER_PORT}"
  76. depends_on:
  77. - db
  78. command: ["workspace", "query-node-root", "query-node:start:prod"]
  79. processor:
  80. image: joystream/apps
  81. restart: unless-stopped
  82. build:
  83. context: .
  84. dockerfile: apps.Dockerfile
  85. env_file:
  86. # relative to working directory where docker-compose was run from
  87. - .env
  88. environment:
  89. - INDEXER_ENDPOINT_URL=http://indexer-api-gateway:${WARTHOG_APP_PORT}/graphql
  90. - TYPEORM_HOST=db
  91. - TYPEORM_DATABASE=${DB_NAME}
  92. - DEBUG=index-builder:*
  93. - WS_PROVIDER_ENDPOINT_URI=${WS_PROVIDER_ENDPOINT_URI}
  94. depends_on:
  95. - hydra-indexer-gateway
  96. command: ["workspace", "query-node-root", "processor:start"]
  97. indexer:
  98. image: joystream/hydra-indexer:latest
  99. restart: unless-stopped
  100. env_file:
  101. # relative to working directory where docker-compose was run from
  102. - .env
  103. environment:
  104. - DB_HOST=db
  105. - DB_NAME=${INDEXER_DB_NAME}
  106. - INDEXER_WORKERS=5
  107. - PROCESSOR_POLL_INTERVAL=1000 # refresh every second
  108. - REDIS_URI=redis://redis:6379/0
  109. - DEBUG=index-builder:*
  110. - WS_PROVIDER_ENDPOINT_URI=${WS_PROVIDER_ENDPOINT_URI}
  111. - TYPES_JSON=${TYPES_JSON}
  112. depends_on:
  113. - db
  114. - redis
  115. volumes:
  116. - ${TYPES_JSON}:/home/hydra/packages/hydra-indexer/types/augment/all/defs.json
  117. command: >
  118. sh -c "yarn db:bootstrap && yarn start:prod"
  119. hydra-indexer-gateway:
  120. image: joystream/hydra-indexer-gateway:latest
  121. restart: unless-stopped
  122. env_file:
  123. # relative to working directory where docker-compose was run from
  124. - .env
  125. environment:
  126. - WARTHOG_STARTER_DB_DATABASE=${INDEXER_DB_NAME}
  127. - WARTHOG_STARTER_DB_HOST=db
  128. - WARTHOG_STARTER_DB_PASSWORD=${DB_PASS}
  129. - WARTHOG_STARTER_DB_PORT=${DB_PORT}
  130. - WARTHOG_STARTER_DB_USERNAME=${DB_USER}
  131. - WARTHOG_STARTER_REDIS_URI=redis://redis:6379/0
  132. - WARTHOG_APP_PORT=${WARTHOG_APP_PORT}
  133. - PORT=${WARTHOG_APP_PORT}
  134. - DEBUG=*
  135. ports:
  136. - "127.0.0.1:4000:4002"
  137. depends_on:
  138. - redis
  139. - db
  140. - indexer
  141. redis:
  142. image: redis:6.0-alpine
  143. restart: always
  144. ports:
  145. - "127.0.0.1:6379:6379"
  146. pioneer:
  147. image: joystream/pioneer
  148. build:
  149. context: .
  150. dockerfile: pioneer.Dockerfile
  151. ports:
  152. - "127.0.0.1:3000:80"