Docker: Docker for windows 2.2.0.3 (Engine: 19.03.5, Compose: 1.25.4)
Nginx: Docker (nginx:latest)

Minio

官方Github

简单运行
docker pull minio/minio
docker run -p 9000:9000 minio/minio server /data
Minio compose.yml
version: "3"

services:

  minio:
    image: minio/minio
    container_name: minio
    environment:
      - TZ=Asia/Shanghai
      - MINIO_ACCESS_KEY=accesskey                # 管理用户名
      - MINIO_SECRET_KEY=secretkey                # 管理密码
    volumes:
      - /D/Docker/minio/data:/data                #外置存储
      - /D/Docker/minio/config:/root/.minio        #外置配置
    expose:
      - '9000'
    networks:
      - default
    command:
      - server
      - /data
    restart: unless-stopped

networks:
  default:
    external:
      name: shared
使用SSL证书

在/root/.minio中放入证书和私钥文件

/root/.minio/certs/public.crt
/root/.minio/certs/private.key
使用MinIO
  1. 访问 http://localhost:9000/ 进入MinIO管理界面
  2. 创建bucket,名称最小3个字符,不允许有大写字母、下划线、特殊字符 如@#等
  3. 给bucket内所有文件增加只读策略,实现永久外链访问 (关键步骤)

PicUploader

官方Github

PicUploader compose.yml
version: "3"

services:

  picuploader:
    image: leonyff/picuploader:latest
    container_name: picuploader
    environment:
      - TZ=Asia/Shanghai
      - USER=user                    # Web用户名
      - PASSWD=password                # Web用户密码
    volumes:
      - /C/Docker/picuploader/config.php:/var/www/PicUploader/config/config.php        #外挂配置文件
    expose:
      - '80'
    networks:
      - default
    restart: unless-stopped

networks:
  default:
    external:
      name: shared

可访问 http://localhost:80 进入WEB界面

配置config.php

            // 开源自建对象存储服务器Minio:https://github.com/minio/minio
            'minio' => [
                'name' => 'Minio',
                'AccessKeyId' => 'accesskey',
                'AccessKeySecret' => 'secretkey',
                //如果你的minio服务器未设置region,那就留空
                'region' => '',
                'bucket' => 'images',
                'endpoint' => 'http(s)://域名:端口',
                //自定义域名,如果为空,则默认使用endpoint作为域名
                'domain' => '',
                //自定义目录格式:2019/03/31
                'directory' => '/',
                //使用代理,格式:http://127.0.0.1:1087
                'proxy' => '',
            ],
        ],
Nginx HTTPS访问 (以容器互访为例)
server {
    listen      443 ssl;
    server_name minio.domain.com;                                              # 监听请求域名

    ssl_certificate       /etc/ssl/cert.cer;                                # 证书路径
    ssl_certificate_key   /etc/ssl/private.key;                                # 私钥路径
    ssl_protocols SSLv2 SSLv3 TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
    ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
    ssl_prefer_server_ciphers on;

    client_max_body_size 10m;
    fastcgi_buffers 64 4K;
  
    location / {
        proxy_pass https://minio:9000/;                                # 如果minio用了证书,则反代https
        proxy_set_header Host $http_host;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_buffer_size 1M;
        proxy_buffers 8 1M;
        proxy_busy_buffers_size 1M;
        proxy_temp_file_write_size 1M;
        proxy_connect_timeout 300s;
        proxy_send_timeout 300s;
        proxy_read_timeout 300s;
    }
}

PicUploader同理反代80端口,配置好后就能通过 https://minio.domain.com 就访问Web界面了

最后修改:2022 年 03 月 16 日
个人分享,随意打赏