不建议这样使用,建议使用nginx做反向代理,建议使用内网url作为上传文件api的endpoint

1、公钥和私钥配置

根据官网描述(How to secure access to MinIO server with TLS),将TLS的公私钥放到:{{HOME}}/.minio/certs 里

  • 私钥需要命名为:private.key
  • 公钥需要命名为:public.crt (如果公钥是以pem格式结尾,可直接改为crt格式)

我们使用docker容器启动,启动用户root。

docker-compose配置文件

version: '3.1'
 
services:

  sentinel-dashboard:
    image: sentinel-dashboard:1.8.3
    container_name: sentinel-dashboard
    volumes:
      - ./sentinel/logs/csp:/root/logs/csp/
    ports:
      - 8088:8088
    restart: always
    networks:
      - sentinel-dashboard
  minio:
    image: minio/minio:RELEASE.2020-10-28T08-16-50Z-29-g07d7dd632
    container_name: minio
    volumes:
      - ./minio/data1:/data1
      - ./minio/data2:/data2
      - ./minio/data3:/data3
      - ./minio/data4:/data4
      - ./minio/data5:/data5
      - ./minio/config:/root/.minio
    ports:
      - "9000:9000"
    restart: always
    command: server --address "0.0.0.0:9000" /data1 /data2 /data3 /data4 /data5
    environment:
      MINIO_ACCESS_KEY: admin
      MINIO_SECRET_KEY: yuanhangMinio
    logging:
      options:
        max-size: "1500M"
        max-file: "10"
      driver: json-file
    healthcheck:
      test: ["CMD", "curl", "-f", "https://localhost:9000/minio/health/live"]
      interval: 30s
      timeout: 20s
      retries: 3   
    networks:
      - minio      
  seata-server:
    image: seataio/seata-server:1.4.2
    container_name: seata-server
    hostname: seata-server
    ports:
      - "8091:8091"
    restart: always
    environment:
      - SEATA_PORT=8091
      # 注册到nacos上的ip。客户端将通过该ip访问seata服务。
      # 注意公网ip和内网ip的差异。
      - SEATA_IP=xxx.xxx.xxx.xxx
      - SEATA_CONFIG_NAME=file:/root/seata-config/registry
    volumes:
    # 因为registry.conf中是nacos配置中心,只需要把registry.conf放到./seata-server/config文件夹中
      - "./seata-server/config:/root/seata-config"
    networks:
      - seata
networks:
  sentinel-dashboard:
    driver: bridge
  seata:
    driver: bridge
  minio:
    driver: bridge
 
    

容器挂载

   volumes:
      - ./minio/data1:/data1
      - ./minio/data2:/data2
      - ./minio/data3:/data3
      - ./minio/data4:/data4
      - ./minio/data5:/data5
      - ./minio/config:/root/.minio

把私钥和公钥放到  ./minio/config的certs目录下。

启动

  restart: always
    command: server --address "0.0.0.0:9000" /data1 /data2 /data3 /data4 /data5

健康检查

    healthcheck:
      test: ["CMD", "curl", "-f", "https://localhost:9000/minio/health/live"]

然后就可以通过域名https访问,注意此时http访问就不行了,上传文件的代码也要使用https地址。

Logo

北京人形旗下天工造物具身智能开源社区,聚焦具身天工与慧思开物两大平台

更多推荐