# 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 pull_policy: always restart: unless-stopped # 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 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" RUSTFS_ACCESS_KEY_FILE: /run/rustfs-secrets/access_key RUSTFS_SECRET_KEY_FILE: /run/rustfs-secrets/secret_key secrets: - rustfs_access_key - rustfs_secret_key volumes: - rustfs_data:/data networks: heimdall-net: aliases: - rustfs volumes: rustfs_data: secrets: rustfs_access_key: file: ./optional/secrets/rustfs_access_key rustfs_secret_key: file: ./optional/secrets/rustfs_secret_key networks: heimdall-net: name: heimdall-net external: true