docker-compose.test.yml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. # Docker Compose for SeaweedFS S3 IAM Integration Tests
  2. version: '3.8'
  3. services:
  4. # SeaweedFS Master
  5. seaweedfs-master:
  6. image: chrislusf/seaweedfs:latest
  7. container_name: seaweedfs-master-test
  8. command: master -mdir=/data -defaultReplication=000 -port=9333
  9. ports:
  10. - "9333:9333"
  11. volumes:
  12. - master-data:/data
  13. healthcheck:
  14. test: ["CMD", "curl", "-f", "http://localhost:9333/cluster/status"]
  15. interval: 10s
  16. timeout: 5s
  17. retries: 5
  18. networks:
  19. - seaweedfs-test
  20. # SeaweedFS Volume
  21. seaweedfs-volume:
  22. image: chrislusf/seaweedfs:latest
  23. container_name: seaweedfs-volume-test
  24. command: volume -dir=/data -port=8083 -mserver=seaweedfs-master:9333
  25. ports:
  26. - "8083:8083"
  27. volumes:
  28. - volume-data:/data
  29. depends_on:
  30. seaweedfs-master:
  31. condition: service_healthy
  32. healthcheck:
  33. test: ["CMD", "curl", "-f", "http://localhost:8083/status"]
  34. interval: 10s
  35. timeout: 5s
  36. retries: 5
  37. networks:
  38. - seaweedfs-test
  39. # SeaweedFS Filer
  40. seaweedfs-filer:
  41. image: chrislusf/seaweedfs:latest
  42. container_name: seaweedfs-filer-test
  43. command: filer -port=8888 -master=seaweedfs-master:9333 -defaultStoreDir=/data
  44. ports:
  45. - "8888:8888"
  46. volumes:
  47. - filer-data:/data
  48. depends_on:
  49. seaweedfs-master:
  50. condition: service_healthy
  51. seaweedfs-volume:
  52. condition: service_healthy
  53. healthcheck:
  54. test: ["CMD", "curl", "-f", "http://localhost:8888/status"]
  55. interval: 10s
  56. timeout: 5s
  57. retries: 5
  58. networks:
  59. - seaweedfs-test
  60. # SeaweedFS S3 API
  61. seaweedfs-s3:
  62. image: chrislusf/seaweedfs:latest
  63. container_name: seaweedfs-s3-test
  64. command: s3 -port=8333 -filer=seaweedfs-filer:8888 -config=/config/test_config.json
  65. ports:
  66. - "8333:8333"
  67. volumes:
  68. - ./test_config.json:/config/test_config.json:ro
  69. depends_on:
  70. seaweedfs-filer:
  71. condition: service_healthy
  72. healthcheck:
  73. test: ["CMD", "curl", "-f", "http://localhost:8333/"]
  74. interval: 10s
  75. timeout: 5s
  76. retries: 5
  77. networks:
  78. - seaweedfs-test
  79. # Test Runner
  80. integration-tests:
  81. build:
  82. context: ../../../
  83. dockerfile: test/s3/iam/Dockerfile.s3
  84. container_name: seaweedfs-s3-iam-tests
  85. environment:
  86. - WEED_BINARY=weed
  87. - S3_PORT=8333
  88. - FILER_PORT=8888
  89. - MASTER_PORT=9333
  90. - VOLUME_PORT=8083
  91. - TEST_TIMEOUT=30m
  92. - LOG_LEVEL=2
  93. depends_on:
  94. seaweedfs-s3:
  95. condition: service_healthy
  96. volumes:
  97. - .:/app/test/s3/iam
  98. - test-results:/app/test-results
  99. networks:
  100. - seaweedfs-test
  101. command: ["make", "test"]
  102. # Optional: Mock LDAP Server for LDAP testing
  103. ldap-server:
  104. image: osixia/openldap:1.5.0
  105. container_name: ldap-server-test
  106. environment:
  107. LDAP_ORGANISATION: "Example Corp"
  108. LDAP_DOMAIN: "example.com"
  109. LDAP_ADMIN_PASSWORD: "admin-password"
  110. LDAP_CONFIG_PASSWORD: "config-password"
  111. LDAP_READONLY_USER: "true"
  112. LDAP_READONLY_USER_USERNAME: "readonly"
  113. LDAP_READONLY_USER_PASSWORD: "readonly-password"
  114. ports:
  115. - "389:389"
  116. - "636:636"
  117. volumes:
  118. - ldap-data:/var/lib/ldap
  119. - ldap-config:/etc/ldap/slapd.d
  120. networks:
  121. - seaweedfs-test
  122. # Optional: LDAP Admin UI
  123. ldap-admin:
  124. image: osixia/phpldapadmin:latest
  125. container_name: ldap-admin-test
  126. environment:
  127. PHPLDAPADMIN_LDAP_HOSTS: "ldap-server"
  128. PHPLDAPADMIN_HTTPS: "false"
  129. ports:
  130. - "8080:80"
  131. depends_on:
  132. - ldap-server
  133. networks:
  134. - seaweedfs-test
  135. volumes:
  136. master-data:
  137. driver: local
  138. volume-data:
  139. driver: local
  140. filer-data:
  141. driver: local
  142. ldap-data:
  143. driver: local
  144. ldap-config:
  145. driver: local
  146. test-results:
  147. driver: local
  148. networks:
  149. seaweedfs-test:
  150. driver: bridge
  151. ipam:
  152. config:
  153. - subnet: 172.20.0.0/16