docker-compose.yml 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  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. colossus:
  21. image: joystream/colossus:latest
  22. restart: on-failure
  23. build:
  24. context: .
  25. dockerfile: colossus.Dockerfile
  26. depends_on:
  27. - graphql-server-mnt
  28. volumes:
  29. - /data
  30. - /keystore
  31. - /logs
  32. ports:
  33. - '127.0.0.1:3333:3333'
  34. env_file:
  35. # relative to working directory where docker-compose was run from
  36. - .env
  37. environment:
  38. - COLOSSUS_PORT=3333
  39. - QUERY_NODE_ENDPOINT=http://graphql-server-mnt:${GRAPHQL_SERVER_PORT}/graphql
  40. - WORKER_ID=0
  41. - ACCOUNT_URI=//Alice
  42. # enable ElasticSearch server
  43. # - ELASTIC_SEARCH_ENDPOINT=host.docker.internal:9200
  44. db:
  45. image: postgres:12
  46. restart: always
  47. ports:
  48. - "127.0.0.1:${DB_PORT}:5432"
  49. volumes:
  50. - /var/lib/postgresql/data
  51. env_file:
  52. # relative to working directory where docker-compose was run from
  53. - .env
  54. environment:
  55. POSTGRES_USER: ${DB_USER}
  56. POSTGRES_PASSWORD: ${DB_PASS}
  57. POSTGRES_DB: ${INDEXER_DB_NAME}
  58. graphql-server:
  59. image: joystream/apps
  60. restart: unless-stopped
  61. build:
  62. context: .
  63. dockerfile: apps.Dockerfile
  64. network: joystream_default
  65. env_file:
  66. # relative to working directory where docker-compose was run from
  67. - .env
  68. ports:
  69. - "127.0.0.1:8081:${GRAPHQL_SERVER_PORT}"
  70. depends_on:
  71. - db
  72. command: ["workspace", "query-node-root", "query-node:start:prod"]
  73. graphql-server-mnt:
  74. image: node:14
  75. restart: unless-stopped
  76. env_file:
  77. # relative to working directory where docker-compose was run from
  78. - .env
  79. ports:
  80. - "127.0.0.1:8081:${GRAPHQL_SERVER_PORT}"
  81. depends_on:
  82. - db
  83. volumes:
  84. - type: bind
  85. source: .
  86. target: /joystream
  87. working_dir: /joystream
  88. command: ["yarn", "workspace", "query-node-root", "query-node:start:prod"]
  89. processor:
  90. image: joystream/apps
  91. restart: unless-stopped
  92. build:
  93. context: .
  94. dockerfile: apps.Dockerfile
  95. network: joystream_default
  96. env_file:
  97. # relative to working directory where docker-compose was run from
  98. - .env
  99. environment:
  100. - INDEXER_ENDPOINT_URL=http://hydra-indexer-gateway:${WARTHOG_APP_PORT}/graphql
  101. - TYPEORM_HOST=${DB_HOST}
  102. - TYPEORM_DATABASE=${DB_NAME}
  103. - WS_PROVIDER_ENDPOINT_URI=${WS_PROVIDER_ENDPOINT_URI}
  104. volumes:
  105. - ./types/augment/all/defs.json:/joystream/query-node/mappings/lib/generated/types/typedefs.json
  106. depends_on:
  107. - hydra-indexer-gateway
  108. command: ["workspace", "query-node-root", "processor:start"]
  109. processor-mnt:
  110. image: node:14
  111. restart: unless-stopped
  112. env_file:
  113. # relative to working directory where docker-compose was run from
  114. - .env
  115. environment:
  116. - INDEXER_ENDPOINT_URL=http://hydra-indexer-gateway:${WARTHOG_APP_PORT}/graphql
  117. - TYPEORM_HOST=${DB_HOST}
  118. - TYPEORM_DATABASE=${DB_NAME}
  119. depends_on:
  120. - hydra-indexer-gateway
  121. volumes:
  122. - type: bind
  123. source: .
  124. target: /joystream
  125. working_dir: /joystream
  126. command: ["yarn", "workspace", "query-node-root", "processor:start"]
  127. indexer:
  128. image: joystream/hydra-indexer:3.0.0
  129. restart: unless-stopped
  130. env_file:
  131. # relative to working directory where docker-compose was run from
  132. - .env
  133. environment:
  134. - DB_NAME=${INDEXER_DB_NAME}
  135. - INDEXER_WORKERS=5
  136. - REDIS_URI=redis://redis:6379/0
  137. - TYPES_JSON=types.json
  138. depends_on:
  139. - db
  140. - redis
  141. volumes:
  142. - ./types/augment/all/defs.json:/home/hydra/packages/hydra-indexer/types.json
  143. command: >
  144. sh -c "yarn db:bootstrap && yarn start:prod"
  145. hydra-indexer-gateway:
  146. image: joystream/hydra-indexer-gateway:3.0.0
  147. restart: unless-stopped
  148. env_file:
  149. # relative to working directory where docker-compose was run from
  150. - .env
  151. environment:
  152. - WARTHOG_STARTER_DB_DATABASE=${INDEXER_DB_NAME}
  153. - WARTHOG_STARTER_DB_HOST=db
  154. - WARTHOG_STARTER_DB_PASSWORD=${DB_PASS}
  155. - WARTHOG_STARTER_DB_PORT=${DB_PORT}
  156. - WARTHOG_STARTER_DB_USERNAME=${DB_USER}
  157. - WARTHOG_STARTER_REDIS_URI=redis://redis:6379/0
  158. - WARTHOG_APP_PORT=${WARTHOG_APP_PORT}
  159. - PORT=${WARTHOG_APP_PORT}
  160. - DEBUG=*
  161. ports:
  162. - "127.0.0.1:4000:${WARTHOG_APP_PORT}"
  163. depends_on:
  164. - redis
  165. - db
  166. - indexer
  167. redis:
  168. image: redis:6.0-alpine
  169. restart: always
  170. ports:
  171. - "127.0.0.1:6379:6379"
  172. pioneer:
  173. image: joystream/pioneer
  174. build:
  175. context: .
  176. dockerfile: pioneer.Dockerfile
  177. ports:
  178. - "127.0.0.1:3000:80"