mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-12-06 17:52:16 +00:00
Replace MinIO with RustFS for local S3 storage
This commit is contained in:
committed by
Constantin Graf
parent
560f12242f
commit
046b28b3de
14
README.md
14
README.md
@@ -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/)
|
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
|
## Issues & Feature Requests
|
||||||
|
|
||||||
If you
|
If you
|
||||||
|
|||||||
@@ -127,20 +127,24 @@ services:
|
|||||||
- reverse-proxy
|
- reverse-proxy
|
||||||
volumes:
|
volumes:
|
||||||
- '.:/src'
|
- '.:/src'
|
||||||
minio:
|
rustfs:
|
||||||
image: 'minio/minio:latest'
|
image: 'rustfs/rustfs:1.0.7'
|
||||||
environment:
|
environment:
|
||||||
MINIO_BROWSER_REDIRECT_URL: 'https://storage-management.${NGINX_HOST_NAME}'
|
RUSTFS_ACCESS_KEY: 'sail'
|
||||||
MINIO_ROOT_USER: 'sail'
|
RUSTFS_SECRET_KEY: 'password'
|
||||||
MINIO_ROOT_PASSWORD: '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:
|
volumes:
|
||||||
- 'sail-minio:/data/minio'
|
- 'sail-rustfs:/data'
|
||||||
networks:
|
networks:
|
||||||
- reverse-proxy
|
- reverse-proxy
|
||||||
- sail
|
- sail
|
||||||
command: minio server /data/minio --console-address ":8900"
|
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: [ "CMD", "mc", "ready", "local" ]
|
test: [ "CMD", "curl", "-fsS", "http://localhost:9000/health/ready" ]
|
||||||
interval: 5s
|
interval: 5s
|
||||||
timeout: 5s
|
timeout: 5s
|
||||||
retries: 5
|
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.service=solidtime-dev-storage-frontend"
|
||||||
- "traefik.http.routers.solidtime-dev-storage-frontend-https.entrypoints=websecure"
|
- "traefik.http.routers.solidtime-dev-storage-frontend-https.entrypoints=websecure"
|
||||||
- "traefik.http.routers.solidtime-dev-storage-frontend-https.tls=true"
|
- "traefik.http.routers.solidtime-dev-storage-frontend-https.tls=true"
|
||||||
# Storage Management
|
# Storage Management (RustFS console)
|
||||||
- "traefik.http.services.solidtime-dev-storage-management.loadbalancer.server.port=8900"
|
# 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
|
# http
|
||||||
- "traefik.http.routers.solidtime-dev-storage-management.rule=Host(`storage-management.${NGINX_HOST_NAME}`)"
|
- "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.service=solidtime-dev-storage-management"
|
||||||
- "traefik.http.routers.solidtime-dev-storage-management.entrypoints=web"
|
- "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
|
# https
|
||||||
- "traefik.http.routers.solidtime-dev-storage-management-https.rule=Host(`storage-management.${NGINX_HOST_NAME}`)"
|
- "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.service=solidtime-dev-storage-management"
|
||||||
- "traefik.http.routers.solidtime-dev-storage-management-https.entrypoints=websecure"
|
- "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-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:
|
rustfs-create-bucket:
|
||||||
image: minio/mc:latest
|
image: 'rustfs/rustfs:1.0.7'
|
||||||
depends_on:
|
depends_on:
|
||||||
minio:
|
rustfs:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
environment:
|
environment:
|
||||||
S3_ACCESS_KEY_ID: ${S3_ACCESS_KEY_ID}
|
S3_ACCESS_KEY_ID: ${S3_ACCESS_KEY_ID}
|
||||||
S3_SECRET_ACCESS_KEY: ${S3_SECRET_ACCESS_KEY}
|
S3_SECRET_ACCESS_KEY: ${S3_SECRET_ACCESS_KEY}
|
||||||
S3_BUCKET: ${S3_BUCKET}
|
S3_BUCKET: ${S3_BUCKET}
|
||||||
S3_ENDPOINT: ${S3_ENDPOINT}
|
|
||||||
volumes:
|
|
||||||
- './docker/local/minio:/etc/minio'
|
|
||||||
networks:
|
networks:
|
||||||
- sail
|
- sail
|
||||||
- reverse-proxy
|
entrypoint: [ '/bin/sh', '-c' ]
|
||||||
entrypoint: /etc/minio/create_bucket.sh
|
command:
|
||||||
extra_hosts:
|
- |
|
||||||
- "storage.${NGINX_HOST_NAME}:${REVERSE_PROXY_IP:-10.100.100.10}"
|
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:
|
gotenberg:
|
||||||
image: gotenberg/gotenberg:8
|
image: gotenberg/gotenberg:8
|
||||||
@@ -206,5 +225,5 @@ volumes:
|
|||||||
driver: local
|
driver: local
|
||||||
sail-pgsql-test:
|
sail-pgsql-test:
|
||||||
driver: local
|
driver: local
|
||||||
sail-minio:
|
sail-rustfs:
|
||||||
driver: local
|
driver: local
|
||||||
|
|||||||
@@ -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;
|
|
||||||
Reference in New Issue
Block a user