improve code for dockerfile

This commit is contained in:
houseme
2025-04-03 01:59:28 +08:00
parent 5de28e6e7e
commit 4136dd5393
4 changed files with 17 additions and 19 deletions
+3 -3
View File
@@ -1,11 +1,11 @@
[observability] [observability]
endpoint = "http://localhost:4317" # Default is "http://localhost:4317" if not specified endpoint = "http://localhost:4317" # Default is "http://localhost:4317" if not specified
use_stdout = true use_stdout = false # Output with stdout, true output, false no output
sample_ratio = 2.0 sample_ratio = 2.0
meter_interval = 30 meter_interval = 30
service_name = "rustfs" service_name = "rustfs"
service_version = "0.1.0" service_version = "0.1.0"
environments = "develop" environments = "production"
logger_level = "info" logger_level = "info"
[sinks] [sinks]
@@ -25,7 +25,7 @@ batch_timeout_ms = 1000 # Default is 100ms if not specified
[sinks.file] [sinks.file]
enabled = true enabled = true
path = "/Users/qun/Documents/rust/rustfs/s3-rustfs/logs/app.log" path = "/root/data/logs/app.log"
batch_size = 10 batch_size = 10
batch_timeout_ms = 1000 # Default is 8192 bytes if not specified batch_timeout_ms = 1000 # Default is 8192 bytes if not specified
+1 -3
View File
@@ -3,12 +3,10 @@ FROM alpine:latest
# RUN apk add --no-cache <package-name> # RUN apk add --no-cache <package-name>
# 如果 rustfs 有依赖,可以在这里添加,例如: # 如果 rustfs 有依赖,可以在这里添加,例如:
# RUN apk add --no-cache openssl # RUN apk add --no-cache openssl
# RUN apk add --no-cache bash # 安装 Bash
WORKDIR /app WORKDIR /app
# 创建与 RUSTFS_VOLUMES 一致的目录
# RUN mkdir -p /root/data/target/volume/test1 /root/data/target/volume/test2 /root/data/target/volume/test3 /root/data/target/volume/test4
COPY ./target/x86_64-unknown-linux-musl/release/rustfs /app/rustfs COPY ./target/x86_64-unknown-linux-musl/release/rustfs /app/rustfs
RUN chmod +x /app/rustfs RUN chmod +x /app/rustfs
+4 -4
View File
@@ -62,7 +62,7 @@ services:
dockerfile: Dockerfile.obs dockerfile: Dockerfile.obs
container_name: node1 container_name: node1
environment: environment:
- RUSTFS_VOLUMES=http://node{1...4}:9000/root/data/target/volume/test{1...4} - RUSTFS_VOLUMES=/root/data/target/volume/test{1...4}
- RUSTFS_ADDRESS=0.0.0.0:9000 - RUSTFS_ADDRESS=0.0.0.0:9000
- RUSTFS_CONSOLE_ENABLE=true - RUSTFS_CONSOLE_ENABLE=true
- RUSTFS_CONSOLE_ADDRESS=0.0.0.0:9002 - RUSTFS_CONSOLE_ADDRESS=0.0.0.0:9002
@@ -83,7 +83,7 @@ services:
dockerfile: Dockerfile.obs dockerfile: Dockerfile.obs
container_name: node2 container_name: node2
environment: environment:
- RUSTFS_VOLUMES=http://node{1...4}:9000/root/data/target/volume/test{1...4} - RUSTFS_VOLUMES=/root/data/target/volume/test{1...4}
- RUSTFS_ADDRESS=0.0.0.0:9000 - RUSTFS_ADDRESS=0.0.0.0:9000
- RUSTFS_CONSOLE_ENABLE=true - RUSTFS_CONSOLE_ENABLE=true
- RUSTFS_CONSOLE_ADDRESS=0.0.0.0:9002 - RUSTFS_CONSOLE_ADDRESS=0.0.0.0:9002
@@ -104,7 +104,7 @@ services:
dockerfile: Dockerfile.obs dockerfile: Dockerfile.obs
container_name: node3 container_name: node3
environment: environment:
- RUSTFS_VOLUMES=http://node{1...4}:9000/root/data/target/volume/test{1...4} - RUSTFS_VOLUMES=/root/data/target/volume/test{1...4}
- RUSTFS_ADDRESS=0.0.0.0:9000 - RUSTFS_ADDRESS=0.0.0.0:9000
- RUSTFS_CONSOLE_ENABLE=true - RUSTFS_CONSOLE_ENABLE=true
- RUSTFS_CONSOLE_ADDRESS=0.0.0.0:9002 - RUSTFS_CONSOLE_ADDRESS=0.0.0.0:9002
@@ -125,7 +125,7 @@ services:
dockerfile: Dockerfile.obs dockerfile: Dockerfile.obs
container_name: node4 container_name: node4
environment: environment:
- RUSTFS_VOLUMES=http://node{1...4}:9000/root/data/target/volume/test{1...4} - RUSTFS_VOLUMES=/root/data/target/volume/test{1...4}
- RUSTFS_ADDRESS=0.0.0.0:9000 - RUSTFS_ADDRESS=0.0.0.0:9000
- RUSTFS_CONSOLE_ENABLE=true - RUSTFS_CONSOLE_ENABLE=true
- RUSTFS_CONSOLE_ADDRESS=0.0.0.0:9002 - RUSTFS_CONSOLE_ADDRESS=0.0.0.0:9002
+1 -1
View File
@@ -1535,7 +1535,7 @@ impl StorageAPI for ECStore {
for (i, sets) in self.pools.iter().enumerate() { for (i, sets) in self.pools.iter().enumerate() {
// 取 pool idx 对应的 objects index // 取 pool idx 对应的 objects index
if let Some(objs) = pool_obj_idx_map.get(&i) { if let Some(objs) = pool_obj_idx_map.get(&i) {
// 取对应obj,理论上不会none // 取对应 obj理论上不会 none
// let objs: Vec<ObjectToDelete> = obj_idxs.iter().filter_map(|&idx| objects.get(idx).cloned()).collect(); // let objs: Vec<ObjectToDelete> = obj_idxs.iter().filter_map(|&idx| objects.get(idx).cloned()).collect();
if objs.is_empty() { if objs.is_empty() {