2026-10-26 05:59:55 +01:00
|
|
|
# Optional S3-compatible object store. Start the core Compose first so the
|
|
|
|
|
# shared heimdall-net exists, then configure storage in Central to use rustfs.
|
|
|
|
|
services:
|
|
|
|
|
rustfs:
|
|
|
|
|
image: rustfs/rustfs:latest
|
2026-10-28 06:38:24 +01:00
|
|
|
pull_policy: always
|
2026-10-26 05:59:55 +01:00
|
|
|
restart: unless-stopped
|
2026-11-12 06:34:19 +01:00
|
|
|
# Compose file secrets are read-only bind mounts locally. The installer
|
|
|
|
|
# deliberately creates them mode 0600, owned by root; RustFS runs as UID
|
|
|
|
|
# 10001 and cannot read that source directly. A small root init copies the
|
|
|
|
|
# files into tmpfs, then drops privileges before starting the server.
|
|
|
|
|
user: "0:0"
|
|
|
|
|
read_only: true
|
|
|
|
|
cap_drop:
|
|
|
|
|
- ALL
|
|
|
|
|
cap_add:
|
|
|
|
|
- CHOWN
|
|
|
|
|
- DAC_OVERRIDE
|
|
|
|
|
- SETGID
|
|
|
|
|
- SETUID
|
|
|
|
|
security_opt:
|
|
|
|
|
- no-new-privileges:true
|
|
|
|
|
tmpfs:
|
|
|
|
|
- /run/rustfs-secrets:rw,noexec,nosuid,nodev,size=1m,mode=0700
|
|
|
|
|
- /logs:rw,noexec,nosuid,nodev,size=16m,mode=1777
|
|
|
|
|
- /tmp:rw,noexec,nosuid,nodev,size=16m,mode=1777
|
|
|
|
|
entrypoint: ["/bin/sh", "-c"]
|
|
|
|
|
command:
|
|
|
|
|
- >-
|
|
|
|
|
set -eu;
|
|
|
|
|
umask 077;
|
|
|
|
|
cp /run/secrets/rustfs_access_key /run/rustfs-secrets/access_key;
|
|
|
|
|
cp /run/secrets/rustfs_secret_key /run/rustfs-secrets/secret_key;
|
|
|
|
|
chown 10001:10001 /run/rustfs-secrets /run/rustfs-secrets/access_key /run/rustfs-secrets/secret_key;
|
|
|
|
|
exec su -s /bin/sh -c 'exec /etc/rustfs/entrypoint.sh rustfs' rustfs
|
2026-10-26 05:59:55 +01:00
|
|
|
ports:
|
|
|
|
|
- "${RUSTFS_API_PORT:-9000}:9000"
|
|
|
|
|
- "${RUSTFS_CONSOLE_PORT:-9001}:9001"
|
|
|
|
|
environment:
|
|
|
|
|
RUSTFS_VOLUMES: /data
|
|
|
|
|
RUSTFS_ADDRESS: 0.0.0.0:9000
|
|
|
|
|
RUSTFS_CONSOLE_ADDRESS: 0.0.0.0:9001
|
|
|
|
|
RUSTFS_CONSOLE_ENABLE: "true"
|
2026-11-12 06:34:19 +01:00
|
|
|
RUSTFS_ACCESS_KEY_FILE: /run/rustfs-secrets/access_key
|
|
|
|
|
RUSTFS_SECRET_KEY_FILE: /run/rustfs-secrets/secret_key
|
2026-10-26 05:59:55 +01:00
|
|
|
secrets:
|
|
|
|
|
- rustfs_access_key
|
|
|
|
|
- rustfs_secret_key
|
|
|
|
|
volumes:
|
|
|
|
|
- rustfs_data:/data
|
|
|
|
|
networks:
|
|
|
|
|
heimdall-net:
|
|
|
|
|
aliases:
|
|
|
|
|
- rustfs
|
|
|
|
|
|
|
|
|
|
volumes:
|
|
|
|
|
rustfs_data:
|
|
|
|
|
|
|
|
|
|
secrets:
|
|
|
|
|
rustfs_access_key:
|
2026-11-10 16:29:10 +01:00
|
|
|
file: ./optional/secrets/rustfs_access_key
|
2026-10-26 05:59:55 +01:00
|
|
|
rustfs_secret_key:
|
2026-11-10 16:29:10 +01:00
|
|
|
file: ./optional/secrets/rustfs_secret_key
|
2026-10-26 05:59:55 +01:00
|
|
|
|
|
|
|
|
networks:
|
|
|
|
|
heimdall-net:
|
|
|
|
|
name: heimdall-net
|
|
|
|
|
external: true
|