docker-compose.yml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  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. - "${DB_PORT}:5432"
  53. volumes:
  54. - /var/lib/postgresql/data
  55. environment:
  56. POSTGRES_USER: ${DB_USER}
  57. POSTGRES_PASSWORD: ${DB_PASS}
  58. POSTGRES_DB: ${DB_NAME}
  59. graphql-server:
  60. image: joystream/apps
  61. restart: unless-stopped
  62. build:
  63. context: .
  64. dockerfile: apps.Dockerfile
  65. env_file:
  66. # relative to working directory where docker-compose was run from
  67. - .env
  68. environment:
  69. - DB_HOST=db
  70. ports:
  71. - "8081:${GRAPHQL_SERVER_PORT}"
  72. depends_on:
  73. - db
  74. command: ["workspace", "query-node-root", "server:start:prod"]
  75. processor:
  76. image: joystream/apps
  77. restart: unless-stopped
  78. build:
  79. context: .
  80. dockerfile: apps.Dockerfile
  81. env_file:
  82. # relative to working directory where docker-compose was run from
  83. - .env
  84. environment:
  85. - INDEXER_ENDPOINT_URL=http://indexer-api-gateway:4000/graphql
  86. - DB_HOST=db
  87. - TYPEORM_HOST=db
  88. - DEBUG=index-builder:*
  89. - WS_PROVIDER_ENDPOINT_URI=${WS_PROVIDER_ENDPOINT_URI}
  90. depends_on:
  91. - indexer-api-gateway
  92. command: ["workspace", "query-node-root", "processor:start"]
  93. indexer:
  94. image: joystream/apps
  95. restart: unless-stopped
  96. build:
  97. context: .
  98. dockerfile: apps.Dockerfile
  99. env_file:
  100. # relative to working directory where docker-compose was run from
  101. - .env
  102. environment:
  103. - TYPEORM_HOST=db
  104. - INDEXER_WORKERS=5
  105. - PROCESSOR_POLL_INTERVAL=1000 # refresh every second
  106. - REDIS_URI=redis://redis:6379/0
  107. - DEBUG=index-builder:*
  108. - WS_PROVIDER_ENDPOINT_URI=${WS_PROVIDER_ENDPOINT_URI}
  109. depends_on:
  110. - db
  111. command: ["workspace", "query-node-root", "indexer:start"]
  112. indexer-api-gateway:
  113. image: joystream/hydra-indexer-gateway:latest
  114. restart: unless-stopped
  115. environment:
  116. - WARTHOG_STARTER_DB_DATABASE=${DB_NAME}
  117. - WARTHOG_STARTER_DB_HOST=db
  118. - WARTHOG_STARTER_DB_PASSWORD=${DB_PASS}
  119. - WARTHOG_STARTER_DB_PORT=${DB_PORT}
  120. - WARTHOG_STARTER_DB_USERNAME=${DB_USER}
  121. - WARTHOG_STARTER_REDIS_URI=redis://redis:6379/0
  122. - PORT=4000
  123. ports:
  124. - "4000:4000"
  125. depends_on:
  126. - redis
  127. - db
  128. - indexer
  129. redis:
  130. image: redis:6.0-alpine
  131. restart: always
  132. ports:
  133. - "6379:6379"
  134. pioneer:
  135. image: joystream/apps
  136. build:
  137. context: .
  138. dockerfile: apps.Dockerfile
  139. ports:
  140. - "127.0.0.1:3000:3000"
  141. command: workspace pioneer start