部署Minio文件服务器

官方docker-compose

  1. version: '3.7'
  2. # starts 4 docker containers running minio server instances. Each
  3. # minio server's web interface will be accessible on the host at port
  4. # 9001 through 9004.
  5. services:
  6. minio1:
  7. image: minio/minio:RELEASE.2019-10-12T01-39-57Z
  8. volumes:
  9. - data1-1:/data1
  10. - data1-2:/data2
  11. ports:
  12. - "9001:9000"
  13. environment:
  14. MINIO_ACCESS_KEY: minio
  15. MINIO_SECRET_KEY: minio123
  16. command: server http://minio{1...4}/data{1...2}
  17. healthcheck:
  18. test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
  19. interval: 30s
  20. timeout: 20s
  21. retries: 3
  22. minio2:
  23. image: minio/minio:RELEASE.2019-10-12T01-39-57Z
  24. volumes:
  25. - data2-1:/data1
  26. - data2-2:/data2
  27. ports:
  28. - "9002:9000"
  29. environment:
  30. MINIO_ACCESS_KEY: minio
  31. MINIO_SECRET_KEY: minio123
  32. command: server http://minio{1...4}/data{1...2}
  33. healthcheck:
  34. test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
  35. interval: 30s
  36. timeout: 20s
  37. retries: 3
  38. minio3:
  39. image: minio/minio:RELEASE.2019-10-12T01-39-57Z
  40. volumes:
  41. - data3-1:/data1
  42. - data3-2:/data2
  43. ports:
  44. - "9003:9000"
  45. environment:
  46. MINIO_ACCESS_KEY: minio
  47. MINIO_SECRET_KEY: minio123
  48. command: server http://minio{1...4}/data{1...2}
  49. healthcheck:
  50. test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
  51. interval: 30s
  52. timeout: 20s
  53. retries: 3
  54. minio4:
  55. image: minio/minio:RELEASE.2019-10-12T01-39-57Z
  56. volumes:
  57. - data4-1:/data1
  58. - data4-2:/data2
  59. ports:
  60. - "9004:9000"
  61. environment:
  62. MINIO_ACCESS_KEY: minio
  63. MINIO_SECRET_KEY: minio123
  64. command: server http://minio{1...4}/data{1...2}
  65. healthcheck:
  66. test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
  67. interval: 30s
  68. timeout: 20s
  69. retries: 3
  70. ## By default this config uses default local driver,
  71. ## For custom volumes replace with volume driver configuration.
  72. volumes:
  73. data1-1:
  74. data1-2:
  75. data2-1:
  76. data2-2:
  77. data3-1:
  78. data3-2:
  79. data4-1:
  80. data4-2:

单机docker-compose

  1. version: "3"
  2. services:
  3. minio:
  4. image: minio/minio:latest
  5. container_name: minio
  6. ports:
  7. - "9000:9000"
  8. volumes:
  9. - "./data:/data"
  10. environment:
  11. MINIO_ACCESS_KEY: "root"
  12. MINIO_SECRET_KEY: "Aa123456"
  13. command: server /data
  14. restart: always
  15. logging:
  16. driver: "json-file"
  17. options:
  18. max-size: "1m"