docker-compose.yml 5.4 KB

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