Replace MinIO with RustFS for local S3 storage

This commit is contained in:
Constantin Graf
2026-12-04 16:07:57 +01:00
parent 7fd9f36d69
commit c6f7683658
3 changed files with 54 additions and 31 deletions

View File

@@ -28,6 +28,20 @@ We also have an examples repository [here](https://github.com/solidtime-io/self-
If you do not want to self-host solidtime or try it out you can sign up for [solidtime cloud](https://www.solidtime.io/)
## Local Development
The local development environment runs on [Laravel Sail](https://laravel.com/docs/sail) behind a Traefik reverse proxy (see `docker-compose.yml`). Copy `.env.example` to `.env` and start it with `./vendor/bin/sail up -d`. With the default `NGINX_HOST_NAME=solidtime.test` these services are available:
| Service | URL |
| --- | --- |
| solidtime | https://solidtime.test |
| Mailpit (emails) | https://mail.solidtime.test |
| RustFS S3 API (file storage) | https://storage.solidtime.test |
| RustFS admin console | https://storage-management.solidtime.test (login: `sail` / `password`) |
| Playwright UI | https://playwright.solidtime.test |
File storage uses [RustFS](https://rustfs.com), an S3-compatible object storage. The `rustfs-create-bucket` service creates the public `local` bucket on startup.
## Issues & Feature Requests
If you

View File

@@ -127,20 +127,24 @@ services:
- reverse-proxy
volumes:
- '.:/src'
minio:
image: 'minio/minio:latest'
rustfs:
image: 'rustfs/rustfs:1.0.7'
environment:
MINIO_BROWSER_REDIRECT_URL: 'https://storage-management.${NGINX_HOST_NAME}'
MINIO_ROOT_USER: 'sail'
MINIO_ROOT_PASSWORD: 'password'
RUSTFS_ACCESS_KEY: 'sail'
RUSTFS_SECRET_KEY: 'password'
RUSTFS_ADDRESS: ':9000'
RUSTFS_CONSOLE_ENABLE: 'true'
RUSTFS_CONSOLE_ADDRESS: ':9001'
RUSTFS_VOLUMES: '/data'
# Logs go to stdout (`docker compose logs rustfs`) instead of /logs inside the container
RUSTFS_OBS_LOG_DIRECTORY: ''
volumes:
- 'sail-minio:/data/minio'
- 'sail-rustfs:/data'
networks:
- reverse-proxy
- sail
command: minio server /data/minio --console-address ":8900"
healthcheck:
test: [ "CMD", "mc", "ready", "local" ]
test: [ "CMD", "curl", "-fsS", "http://localhost:9000/health/ready" ]
interval: 5s
timeout: 5s
retries: 5
@@ -158,36 +162,51 @@ services:
- "traefik.http.routers.solidtime-dev-storage-frontend-https.service=solidtime-dev-storage-frontend"
- "traefik.http.routers.solidtime-dev-storage-frontend-https.entrypoints=websecure"
- "traefik.http.routers.solidtime-dev-storage-frontend-https.tls=true"
# Storage Management
- "traefik.http.services.solidtime-dev-storage-management.loadbalancer.server.port=8900"
# Storage Management (RustFS console)
# The console is served under /rustfs/console/ and `/` returns 403, so GET / is redirected there.
# Only GET / is redirected: the console logs in with a signed STS `POST /`, and redirecting that
# makes the browser replay the signature against /rustfs/console/ (SignatureDoesNotMatch).
- "traefik.http.services.solidtime-dev-storage-management.loadbalancer.server.port=9001"
- "traefik.http.middlewares.solidtime-dev-storage-management-root.redirectregex.regex=^(https?://[^/]+)/?$$"
- "traefik.http.middlewares.solidtime-dev-storage-management-root.redirectregex.replacement=$${1}/rustfs/console/"
# http
- "traefik.http.routers.solidtime-dev-storage-management.rule=Host(`storage-management.${NGINX_HOST_NAME}`)"
- "traefik.http.routers.solidtime-dev-storage-management.service=solidtime-dev-storage-management"
- "traefik.http.routers.solidtime-dev-storage-management.entrypoints=web"
- "traefik.http.routers.solidtime-dev-storage-management-root.rule=Host(`storage-management.${NGINX_HOST_NAME}`) && Method(`GET`) && Path(`/`)"
- "traefik.http.routers.solidtime-dev-storage-management-root.service=solidtime-dev-storage-management"
- "traefik.http.routers.solidtime-dev-storage-management-root.entrypoints=web"
- "traefik.http.routers.solidtime-dev-storage-management-root.middlewares=solidtime-dev-storage-management-root"
# https
- "traefik.http.routers.solidtime-dev-storage-management-https.rule=Host(`storage-management.${NGINX_HOST_NAME}`)"
- "traefik.http.routers.solidtime-dev-storage-management-https.service=solidtime-dev-storage-management"
- "traefik.http.routers.solidtime-dev-storage-management-https.entrypoints=websecure"
- "traefik.http.routers.solidtime-dev-storage-management-https.tls=true"
- "traefik.http.routers.solidtime-dev-storage-management-root-https.rule=Host(`storage-management.${NGINX_HOST_NAME}`) && Method(`GET`) && Path(`/`)"
- "traefik.http.routers.solidtime-dev-storage-management-root-https.service=solidtime-dev-storage-management"
- "traefik.http.routers.solidtime-dev-storage-management-root-https.entrypoints=websecure"
- "traefik.http.routers.solidtime-dev-storage-management-root-https.tls=true"
- "traefik.http.routers.solidtime-dev-storage-management-root-https.middlewares=solidtime-dev-storage-management-root"
minio-create-bucket:
image: minio/mc:latest
rustfs-create-bucket:
image: 'rustfs/rustfs:1.0.7'
depends_on:
minio:
rustfs:
condition: service_healthy
environment:
S3_ACCESS_KEY_ID: ${S3_ACCESS_KEY_ID}
S3_SECRET_ACCESS_KEY: ${S3_SECRET_ACCESS_KEY}
S3_BUCKET: ${S3_BUCKET}
S3_ENDPOINT: ${S3_ENDPOINT}
volumes:
- './docker/local/minio:/etc/minio'
networks:
- sail
- reverse-proxy
entrypoint: /etc/minio/create_bucket.sh
extra_hosts:
- "storage.${NGINX_HOST_NAME}:${REVERSE_PROXY_IP:-10.100.100.10}"
entrypoint: [ '/bin/sh', '-c' ]
command:
- |
set -e
export RC_HOST_local="http://$${S3_ACCESS_KEY_ID}:$${S3_SECRET_ACCESS_KEY}@rustfs:9000"
rc bucket create "local/$${S3_BUCKET}" --ignore-existing
rc bucket anonymous set public "local/$${S3_BUCKET}"
restart: 'no'
gotenberg:
image: gotenberg/gotenberg:8
@@ -206,5 +225,5 @@ volumes:
driver: local
sail-pgsql-test:
driver: local
sail-minio:
sail-rustfs:
driver: local

View File

@@ -1,10 +0,0 @@
#!/bin/sh
# Source: https://helgesver.re/articles/laravel-sail-create-minio-bucket-automatically
/usr/bin/mc alias set local ${S3_ENDPOINT} ${S3_ACCESS_KEY_ID} ${S3_SECRET_ACCESS_KEY};
/usr/bin/mc rm -r --force local/${S3_BUCKET};
/usr/bin/mc mb --ignore-existing local/${S3_BUCKET};
/usr/bin/mc anonymous set public local/${S3_BUCKET};
exit 0;