docker-compose.yml 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. version: '3.8'
  2. services:
  3. # Keycloak Identity Provider
  4. keycloak:
  5. image: quay.io/keycloak/keycloak:26.0.7
  6. container_name: keycloak-iam-test
  7. hostname: keycloak
  8. environment:
  9. KC_BOOTSTRAP_ADMIN_USERNAME: admin
  10. KC_BOOTSTRAP_ADMIN_PASSWORD: admin
  11. KC_HTTP_ENABLED: "true"
  12. KC_HOSTNAME_STRICT: "false"
  13. KC_HOSTNAME_STRICT_HTTPS: "false"
  14. KC_HTTP_RELATIVE_PATH: /
  15. ports:
  16. - "8080:8080"
  17. command: start-dev
  18. networks:
  19. - seaweedfs-iam
  20. healthcheck:
  21. test: ["CMD", "curl", "-f", "http://localhost:8080/health/ready"]
  22. interval: 10s
  23. timeout: 5s
  24. retries: 5
  25. start_period: 60s
  26. # SeaweedFS Master
  27. weed-master:
  28. image: ${SEAWEEDFS_IMAGE:-local/seaweedfs:latest}
  29. container_name: weed-master
  30. hostname: weed-master
  31. ports:
  32. - "9333:9333"
  33. - "19333:19333"
  34. command: "master -ip=weed-master -port=9333 -mdir=/data"
  35. volumes:
  36. - master-data:/data
  37. networks:
  38. - seaweedfs-iam
  39. healthcheck:
  40. test: ["CMD", "wget", "-q", "--spider", "http://localhost:9333/cluster/status"]
  41. interval: 10s
  42. timeout: 5s
  43. retries: 3
  44. start_period: 10s
  45. # SeaweedFS Volume Server
  46. weed-volume:
  47. image: ${SEAWEEDFS_IMAGE:-local/seaweedfs:latest}
  48. container_name: weed-volume
  49. hostname: weed-volume
  50. ports:
  51. - "8083:8083"
  52. - "18083:18083"
  53. command: "volume -ip=weed-volume -port=8083 -dir=/data -mserver=weed-master:9333 -dataCenter=dc1 -rack=rack1"
  54. volumes:
  55. - volume-data:/data
  56. networks:
  57. - seaweedfs-iam
  58. depends_on:
  59. weed-master:
  60. condition: service_healthy
  61. healthcheck:
  62. test: ["CMD", "wget", "-q", "--spider", "http://localhost:8083/status"]
  63. interval: 10s
  64. timeout: 5s
  65. retries: 3
  66. start_period: 10s
  67. # SeaweedFS Filer
  68. weed-filer:
  69. image: ${SEAWEEDFS_IMAGE:-local/seaweedfs:latest}
  70. container_name: weed-filer
  71. hostname: weed-filer
  72. ports:
  73. - "8888:8888"
  74. - "18888:18888"
  75. command: "filer -ip=weed-filer -port=8888 -master=weed-master:9333 -defaultStoreDir=/data"
  76. volumes:
  77. - filer-data:/data
  78. networks:
  79. - seaweedfs-iam
  80. depends_on:
  81. weed-master:
  82. condition: service_healthy
  83. weed-volume:
  84. condition: service_healthy
  85. healthcheck:
  86. test: ["CMD", "wget", "-q", "--spider", "http://localhost:8888/status"]
  87. interval: 10s
  88. timeout: 5s
  89. retries: 3
  90. start_period: 10s
  91. # SeaweedFS S3 API with IAM
  92. weed-s3:
  93. image: ${SEAWEEDFS_IMAGE:-local/seaweedfs:latest}
  94. container_name: weed-s3
  95. hostname: weed-s3
  96. ports:
  97. - "8333:8333"
  98. environment:
  99. WEED_FILER: "weed-filer:8888"
  100. WEED_IAM_CONFIG: "/config/iam_config.json"
  101. WEED_S3_CONFIG: "/config/test_config.json"
  102. GLOG_v: "3"
  103. command: >
  104. sh -c "
  105. echo 'Starting S3 API with IAM...' &&
  106. weed -v=3 s3 -ip=weed-s3 -port=8333
  107. -filer=weed-filer:8888
  108. -config=/config/test_config.json
  109. -iam.config=/config/iam_config.json
  110. "
  111. volumes:
  112. - ./iam_config.json:/config/iam_config.json:ro
  113. - ./test_config.json:/config/test_config.json:ro
  114. networks:
  115. - seaweedfs-iam
  116. depends_on:
  117. weed-filer:
  118. condition: service_healthy
  119. keycloak:
  120. condition: service_healthy
  121. keycloak-setup:
  122. condition: service_completed_successfully
  123. healthcheck:
  124. test: ["CMD", "wget", "-q", "--spider", "http://localhost:8333"]
  125. interval: 10s
  126. timeout: 5s
  127. retries: 5
  128. start_period: 30s
  129. # Keycloak Setup Service
  130. keycloak-setup:
  131. image: alpine/curl:8.4.0
  132. container_name: keycloak-setup
  133. volumes:
  134. - ./setup_keycloak_docker.sh:/setup.sh:ro
  135. - .:/workspace:rw
  136. working_dir: /workspace
  137. networks:
  138. - seaweedfs-iam
  139. depends_on:
  140. keycloak:
  141. condition: service_healthy
  142. command: >
  143. sh -c "
  144. apk add --no-cache bash jq &&
  145. chmod +x /setup.sh &&
  146. /setup.sh
  147. "
  148. volumes:
  149. master-data:
  150. volume-data:
  151. filer-data:
  152. networks:
  153. seaweedfs-iam:
  154. driver: bridge