docker-compose安装minio

satuo20 8月前 ⋅ 260 阅读
  1. 创建一个minio目录,在目录中添加下面两个文件(.env和docker-compose.yml)

.env

MINIO_IP=192.168.0.69

docker-compose.yml (http版本)

version: "3.1"
services:
  com-minio:
    image: quay.io/minio/minio
    container_name: minio
    command: server --console-address ":9001" /data
    environment:
      MINIO_ROOT_USER: user
      MINIO_ROOT_PASSWORD: kp123456
      MINIO_BROWSER_REDIRECT_URL: http://${MINIO_IP}:9001
      MINIO_SERVER_URL: http://${MINIO_IP}:9000
    healthcheck:
      test: ["CMD", "curl", "-f", "http://${MINIO_IP}:9000/minio/health/live"]
      interval: 30s
      timeout: 20s
      retries: 3
    volumes:
      - ./data:/data
    ports:
      - "9000:9000"
      - "9001:9001"

docker-compose.yaml (https版本)

# 使用certgen生成证书
# certgen -ca -host "10.10.0.3,10.10.0.4,10.10.0.5"
# private.key public.crt
version: "3.1"
services:
  kp-minio:
    image: quay.io/minio/minio
    container_name: kp-minio
    command: server --console-address ":9001" /data
    environment:
      MINIO_ROOT_USER: user
      MINIO_ROOT_PASSWORD: kp123456
      MINIO_BROWSER_REDIRECT_URL: https://${MINIO_IP}:9001
      MINIO_SERVER_URL: https://${MINIO_IP}:9000
    healthcheck:
      test: ["CMD", "curl", "-f", "https://${MINIO_IP}:9000/minio/health/live"]
      interval: 30s
      timeout: 20s
      retries: 3
    volumes:
      - ./data:/data
      - ./certs:/root/.minio/certs
    ports:
      - "9000:9000"
      - "9001:9001"

nginx反向代理版本

minio.conf

# 反向代理http版本的minio
server {
    listen      443 ssl;
    #=====需要修改=========替换成自己的域名
    server_name minio.local.yjzhixue.com;
    #=====需要修改=========下面两行替换成自己SSL文件的路径
    # 下面这个证书是从阿里云下载的
    ssl_certificate   /ssl/minio.local.yjzhixue.com.pem;
    ssl_certificate_key  /ssl/minio.local.yjzhixue.com.key;

    ssl_session_cache    shared:SSL:1m;
    ssl_session_timeout  5m;

#    ssl_ciphers  HIGH:!aNULL:!MD5;
    ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
    ssl_prefer_server_ciphers  on;

    location / {
        # 这里代理端口为9000,不要写错了
        proxy_pass http://192.168.0.69:9000;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_connect_timeout   10s;
        proxy_send_timeout      60s;
        proxy_read_timeout      60s;

    }
}

全部评论: 0

    我有话说: