docker-compose.yml 5.2 KB

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