feat: add rustfs

This commit is contained in:
Sun-ZhenXing
2026-07-08 15:44:12 +08:00
parent 902627bbc2
commit 35404c3674
25 changed files with 244 additions and 52 deletions
+33
View File
@@ -0,0 +1,33 @@
# RustFS Version (glibc-based image)
RUSTFS_VERSION=1.0.0-beta.8-glibc
# RustFS Root Credentials
RUSTFS_ACCESS_KEY=rustfsadmin
RUSTFS_SECRET_KEY=rustfsadmin
# API & Console Addresses
RUSTFS_ADDRESS=0.0.0.0:9000
RUSTFS_CONSOLE_ADDRESS=0.0.0.0:9001
# Console
RUSTFS_CONSOLE_ENABLE=true
RUSTFS_CONSOLE_CORS_ALLOWED_ORIGINS=*
# Log Level (info, debug, warn, error)
RUSTFS_OBS_LOGGER_LEVEL=info
# Disk Check Bypass (set to true for local dev only)
RUSTFS_UNSAFE_BYPASS_DISK_CHECK=false
# Ports
RUSTFS_PORT_OVERRIDE_API=9000
RUSTFS_PORT_OVERRIDE_CONSOLE=9001
# Timezone
TZ=UTC
# Resource Limits
RUSTFS_CPU_LIMIT=2.0
RUSTFS_MEMORY_LIMIT=1G
RUSTFS_CPU_RESERVATION=0.5
RUSTFS_MEMORY_RESERVATION=512M
+44
View File
@@ -0,0 +1,44 @@
# RustFS
[English](./README.md) | [中文](./README.zh.md)
RustFS is a high-performance, S3-compatible distributed object storage system built in Rust. It is 2.3x faster than MinIO for 4KB object payloads, fully open-source under the Apache 2.0 license, and supports migration and coexistence with other S3-compatible platforms such as MinIO and Ceph.
Open the Console: <http://localhost:9001>.
## Services
- `rustfs`: The RustFS object storage service.
## Quick Start
```bash
docker compose up -d
```
The default credentials are `rustfsadmin` / `rustfsadmin`. The S3 API is available at <http://localhost:9000> and the Console at <http://localhost:9001>.
## Configuration
- `RUSTFS_VERSION`: The version of the RustFS image (glibc-based), default is `1.0.0-beta.8-glibc`.
- `RUSTFS_PORT_OVERRIDE_API`: The host port for the S3 API, default is `9000`.
- `RUSTFS_PORT_OVERRIDE_CONSOLE`: The host port for the Console Web UI, default is `9001`.
- `RUSTFS_ACCESS_KEY`: The root access key, default is `rustfsadmin`.
- `RUSTFS_SECRET_KEY`: The root secret key, default is `rustfsadmin`.
- `RUSTFS_ADDRESS`: The S3 API listen address, default is `0.0.0.0:9000`.
- `RUSTFS_CONSOLE_ADDRESS`: The Console listen address, default is `0.0.0.0:9001`.
- `RUSTFS_CONSOLE_ENABLE`: Enable the Web Console, default is `true`.
- `RUSTFS_CONSOLE_CORS_ALLOWED_ORIGINS`: CORS allowed origins for the Console, default is `*`.
- `RUSTFS_OBS_LOGGER_LEVEL`: Log level (`info`, `debug`, `warn`, `error`), default is `info`.
- `RUSTFS_UNSAFE_BYPASS_DISK_CHECK`: Bypass strict disk topology checks (for local dev only), default is `false`.
- `TZ`: Timezone setting, default is `UTC`.
## Volumes
- `rustfs_data`: A named volume for storing RustFS object data.
## Security Notes
- The container runs as a non-root user (`10001:10001`). If you switch to host bind mounts, ensure the mounted directories are writable by this user.
- The default credentials are `rustfsadmin` / `rustfsadmin`. Change these in production.
- `no-new-privileges:true` is enforced by default.
+44
View File
@@ -0,0 +1,44 @@
# RustFS
[English](./README.md) | [中文](./README.zh.md)
RustFS 是一个高性能、S3 兼容的分布式对象存储系统,使用 Rust 构建。对 4KB 对象负载,它比 MinIO 快 2.3 倍,完全开源(Apache 2.0 许可),并支持与其他 S3 兼容平台(如 MinIO 和 Ceph)的迁移与共存。
打开控制台:<http://localhost:9001>。
## 服务
- `rustfs`RustFS 对象存储服务。
## 快速开始
```bash
docker compose up -d
```
默认凭据为 `rustfsadmin` / `rustfsadmin`。S3 API 地址为 <http://localhost:9000>,控制台地址为 <http://localhost:9001>。
## 配置
- `RUSTFS_VERSION`RustFS 镜像版本(基于 glibc),默认为 `1.0.0-beta.8-glibc`
- `RUSTFS_PORT_OVERRIDE_API`S3 API 的主机端口,默认为 `9000`
- `RUSTFS_PORT_OVERRIDE_CONSOLE`:控制台 Web UI 的主机端口,默认为 `9001`
- `RUSTFS_ACCESS_KEY`:根访问密钥,默认为 `rustfsadmin`
- `RUSTFS_SECRET_KEY`:根秘密密钥,默认为 `rustfsadmin`
- `RUSTFS_ADDRESS`S3 API 监听地址,默认为 `0.0.0.0:9000`
- `RUSTFS_CONSOLE_ADDRESS`:控制台监听地址,默认为 `0.0.0.0:9001`
- `RUSTFS_CONSOLE_ENABLE`:是否启用 Web 控制台,默认为 `true`
- `RUSTFS_CONSOLE_CORS_ALLOWED_ORIGINS`:控制台 CORS 允许的来源,默认为 `*`
- `RUSTFS_OBS_LOGGER_LEVEL`:日志级别(`info``debug``warn``error`),默认为 `info`
- `RUSTFS_UNSAFE_BYPASS_DISK_CHECK`:跳过严格的磁盘拓扑检查(仅用于本地开发),默认为 `false`
- `TZ`:时区设置,默认为 `UTC`
## 存储卷
- `rustfs_data`:用于存储 RustFS 对象数据的命名卷。
## 安全说明
- 容器以非 root 用户(`10001:10001`)运行。如果改用主机绑定挂载,请确保挂载目录对该用户可写。
- 默认凭据为 `rustfsadmin` / `rustfsadmin`,请在生产环境中更换。
- 默认启用 `no-new-privileges:true`
+55
View File
@@ -0,0 +1,55 @@
# https://github.com/rustfs/rustfs
x-defaults: &defaults
restart: unless-stopped
logging:
driver: json-file
options:
max-size: 100m
max-file: '3'
services:
rustfs:
<<: *defaults
image: ${GLOBAL_REGISTRY:-}rustfs/rustfs:${RUSTFS_VERSION:-1.0.0-beta.8-glibc}
ports:
- '${RUSTFS_PORT_OVERRIDE_API:-9000}:9000'
- '${RUSTFS_PORT_OVERRIDE_CONSOLE:-9001}:9001'
environment:
TZ: ${TZ:-UTC}
RUSTFS_ADDRESS: ${RUSTFS_ADDRESS:-0.0.0.0:9000}
RUSTFS_CONSOLE_ADDRESS: ${RUSTFS_CONSOLE_ADDRESS:-0.0.0.0:9001}
RUSTFS_CONSOLE_ENABLE: ${RUSTFS_CONSOLE_ENABLE:-true}
RUSTFS_CONSOLE_CORS_ALLOWED_ORIGINS: ${RUSTFS_CONSOLE_CORS_ALLOWED_ORIGINS:-*}
RUSTFS_ACCESS_KEY: ${RUSTFS_ACCESS_KEY:-rustfsadmin}
RUSTFS_SECRET_KEY: ${RUSTFS_SECRET_KEY:-rustfsadmin}
RUSTFS_OBS_LOGGER_LEVEL: ${RUSTFS_OBS_LOGGER_LEVEL:-info}
RUSTFS_VOLUMES: /data/rustfs0
RUSTFS_UNSAFE_BYPASS_DISK_CHECK: ${RUSTFS_UNSAFE_BYPASS_DISK_CHECK:-false}
volumes:
- rustfs_data:/data
user: 10001:10001
security_opt:
- no-new-privileges:true
healthcheck:
test:
[
CMD,
sh,
-ec,
"curl -fsS http://127.0.0.1:9000/health && curl -fsS http://127.0.0.1:9001/rustfs/console/health",
]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
deploy:
resources:
limits:
cpus: ${RUSTFS_CPU_LIMIT:-2.0}
memory: ${RUSTFS_MEMORY_LIMIT:-1G}
reservations:
cpus: ${RUSTFS_CPU_RESERVATION:-0.5}
memory: ${RUSTFS_MEMORY_RESERVATION:-512M}
volumes:
rustfs_data: