MinIO
Docker Compose
name: lsky
services:
minio:
image: minio/minio:latest
restart: always
ports:
- 9000:9000
- 9001:9001
environment:
MINIO_ROOT_USER: minioadmin # 设置用户名
MINIO_ROOT_PASSWORD: minioadmin # 设置密码
volumes:
- minio-data:/data
command: server --console-address ":9001" /data
配置 HTTPS (可选)
name: lsky
services:
minio:
image: minio/minio:latest
restart: always
ports:
- 9000:9000
- 9001:9001
environment:
MINIO_ROOT_USER: minioadmin # 设置用户名
MINIO_ROOT_PASSWORD: minioadmin # 设置密码
volumes:
- minio-data:/data
- certfile.crt:/opts/certs/public.crt:ro
- keyfile.key:/opts/certs/private.key:ro
command:
- server
- --console-address
- ":9001"
- --certs-dir
- /opts/certs
- /data
创建存储桶
创建 Access Keys
兰空图床
Docker Compose
name: lsky
services:
lsky:
image: halcyonazure/lsky-pro-docker:latest
restart: always
environment:
- WEB_PORT=8089
ports:
- 8089:8089
volumes:
- ./lsky/:/var/www/html/
lsky-db:
image: postgres:17
restart: always
#ports:
# - 5432:5432
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password # 密码
POSTGRES_DB: lsky
volumes:
- ./lsky-db/:/var/lib/postgresql/data/
token 获取
curl -X POST 'https://xxx.xxx.xxx/api/v1' \
-H 'Content-Type: application/json' \
-d '{"email":"邮箱地址", "password":"密码"}'
{
"status": true,
"message": "success",
"data": {
"token": "2|xxxxuvgAuAimZlbTNKQw6iezO5CdIQo2dPN9xxxx"
}
}
app/Services/ImageService.php
...
StrategyKey::Minio => new AwsS3V3Adapter(
client: new S3Client([
'credentials' => [
'key' => $configs->get(MinioOption::AccessKey),
'secret' => $configs->get(MinioOption::SecretKey)
],
'endpoint' => $configs->get(MinioOption::Endpoint),
'region' => $configs->get(MinioOption::Region),
'version' => '2006-03-01',
'bucket_endpoint' => (bool)$configs->get(MinioOption::BucketEndpoint),
'use_path_style_endpoint' => true,
...
配置 MinIO 存储
名称:随意
储存策略: Minio
访问域名: https://xxx.xxx.com:port/bucket
AccessKey:
SecretKey:
连接地址: https://xxx.xxx.com:port
区域:
储存桶名称:
BucketEndpoint: