docker-compose.yml 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  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=${PROCESSOR_DB_NAME}
  74. ports:
  75. - "127.0.0.1:8081:${GRAPHQL_SERVER_PORT}"
  76. depends_on:
  77. - db
  78. command: ["workspace", "query-node-root", "server: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=${PROCESSOR_DB_NAME}
  92. - DEBUG=index-builder:*
  93. - WS_PROVIDER_ENDPOINT_URI=ws://joystream-node:9944
  94. depends_on:
  95. - indexer-api-gateway
  96. command: ["workspace", "query-node-root", "processor:start"]
  97. indexer:
  98. image: joystream/apps
  99. restart: unless-stopped
  100. build:
  101. context: .
  102. dockerfile: apps.Dockerfile
  103. env_file:
  104. # relative to working directory where docker-compose was run from
  105. - .env
  106. environment:
  107. - TYPEORM_HOST=db
  108. - TYPEORM_DATABASE=${INDEXER_DB_NAME}
  109. - INDEXER_WORKERS=5
  110. - PROCESSOR_POLL_INTERVAL=1000 # refresh every second
  111. - REDIS_URI=redis://redis:6379/0
  112. - DEBUG=index-builder:*
  113. - WS_PROVIDER_ENDPOINT_URI=ws://joystream-node:9944
  114. depends_on:
  115. - db
  116. command: ["workspace", "query-node-root", "indexer:start"]
  117. indexer-api-gateway:
  118. image: joystream/hydra-indexer-gateway:latest
  119. restart: unless-stopped
  120. env_file:
  121. # relative to working directory where docker-compose was run from
  122. - .env
  123. environment:
  124. - WARTHOG_STARTER_DB_DATABASE=${INDEXER_DB_NAME}
  125. - WARTHOG_STARTER_DB_HOST=db
  126. - WARTHOG_STARTER_DB_PASSWORD=${DB_PASS}
  127. - WARTHOG_STARTER_DB_PORT=${DB_PORT}
  128. - WARTHOG_STARTER_DB_USERNAME=${DB_USER}
  129. - WARTHOG_STARTER_REDIS_URI=redis://redis:6379/0
  130. - WARTHOG_APP_PORT=${WARTHOG_APP_PORT}
  131. - PORT=${WARTHOG_APP_PORT}
  132. - DEBUG=*
  133. ports:
  134. - "127.0.0.1:4000:4002"
  135. depends_on:
  136. - redis
  137. - db
  138. - indexer
  139. redis:
  140. image: redis:6.0-alpine
  141. restart: always
  142. ports:
  143. - "127.0.0.1:6379:6379"
  144. pioneer:
  145. image: joystream/apps
  146. build:
  147. context: .
  148. dockerfile: apps.Dockerfile
  149. ports:
  150. - "127.0.0.1:3000:3000"
  151. command: workspace pioneer start