chg: pkg: migrate from shitty Minio to RustFS #16
Deploy to Production / deploy (push) Successful in 3m9s

This commit is contained in:
Lang
2026-10-24 17:45:19 +02:00
parent 1d8d0ac110
commit 3e90bbe5cf
10 changed files with 509 additions and 64 deletions
+74 -15
View File
@@ -6,7 +6,7 @@ services:
restart: unless-stopped
container_name: '${APP_NAME}-app'
ports:
- "10080:80"
- "${APP_PUBLISHED_PORT:-10080}:80"
environment:
SERVER_NAME: ${SERVER_NAME:-:80}
APP_ENV: prod
@@ -32,7 +32,7 @@ services:
WEBAUTHN_ORIGIN: ${WEBAUTHN_ORIGIN:-https://localhost}
MINIO_ROOT_USER: ${MINIO_ROOT_USER}
MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD}
MINIO_ENDPOINT: http://minio:9000
MINIO_ENDPOINT: http://rustfs:9000
MINIO_PUBLIC_URL: ${MINIO_PUBLIC_URL:-http://localhost:9010}
# IMPORTANT: Set TRUSTED_PROXIES to your reverse proxy IP in production.
# For Docker on same host, use: 172.17.0.1 (default bridge) or 172.16.0.0/12 (overlay network)
@@ -43,11 +43,21 @@ services:
- app_var:/app/var
- caddy_data:/data
- caddy_config:/config
healthcheck:
test: ["CMD-SHELL", "curl -fsS http://127.0.0.1/ -o /dev/null"]
interval: 10s
timeout: 5s
retries: 12
start_period: 60s
depends_on:
db:
condition: service_healthy
mail:
condition: service_started
rustfs:
condition: service_healthy
storage_init:
condition: service_completed_successfully
scheduler:
build:
context: .
@@ -77,7 +87,7 @@ services:
WEBAUTHN_ORIGIN: ${WEBAUTHN_ORIGIN:-https://localhost}
MINIO_ROOT_USER: ${MINIO_ROOT_USER}
MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD}
MINIO_ENDPOINT: http://minio:9000
MINIO_ENDPOINT: http://rustfs:9000
MINIO_PUBLIC_URL: ${MINIO_PUBLIC_URL:-http://localhost:9010}
TRUSTED_PROXIES: ${TRUSTED_PROXIES:-127.0.0.1}
volumes:
@@ -87,17 +97,59 @@ services:
condition: service_healthy
mail:
condition: service_started
rustfs:
condition: service_healthy
storage_init:
condition: service_completed_successfully
healthcheck:
disable: true
rustfs:
image: rustfs/rustfs:1.0.3
restart: unless-stopped
container_name: '${APP_NAME}-rustfs'
environment:
RUSTFS_ACCESS_KEY: ${MINIO_ROOT_USER}
RUSTFS_SECRET_KEY: ${MINIO_ROOT_PASSWORD}
RUSTFS_ADDRESS: ':9000'
RUSTFS_CONSOLE_ADDRESS: ':9001'
RUSTFS_CONSOLE_ENABLE: 'true'
volumes:
- rustfs_data:/data
ports:
- "${RUSTFS_PUBLISHED_API_PORT:-9010}:9000"
- "${RUSTFS_PUBLISHED_CONSOLE_PORT:-9011}:9001"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/health"]
interval: 5s
timeout: 5s
retries: 20
start_period: 15s
storage_init:
build:
context: ./docker/storage-migrate
entrypoint: ["python"]
command: ["/usr/local/bin/storage-init.py"]
restart: "no"
container_name: '${APP_NAME}-storage-init'
depends_on:
rustfs:
condition: service_healthy
environment:
TARGET_ENDPOINT: http://rustfs:9000
STORAGE_ACCESS_KEY: ${MINIO_ROOT_USER}
STORAGE_SECRET_KEY: ${MINIO_ROOT_PASSWORD}
STORAGE_BUCKET: mineseeker
minio:
image: minio/minio:RELEASE.2025-09-07T16-13-09Z-cpuv1
profiles: ["storage-migration"]
image: ${MINIO_IMAGE:-minio/minio:RELEASE.2025-09-07T16-13-09Z-cpuv1}
pull_policy: never
restart: unless-stopped
container_name: '${APP_NAME}-minio'
command: server /data --console-address ":9001"
ports:
- "9010:9000"
- "9011:9001"
- "${MINIO_PUBLISHED_API_PORT:-9012}:9000"
- "${MINIO_PUBLISHED_CONSOLE_PORT:-9013}:9001"
environment:
MINIO_ROOT_USER: ${MINIO_ROOT_USER}
MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD}
@@ -109,20 +161,25 @@ services:
timeout: 5s
retries: 10
start_period: 10s
minio_init:
image: minio/minio:RELEASE.2025-09-07T16-13-09Z-cpuv1
profiles: ['bootstrap']
storage_migrate:
profiles: ["storage-migration"]
build:
context: ./docker/storage-migrate
restart: "no"
container_name: '${APP_NAME}-minio-init'
container_name: '${APP_NAME}-storage-migrate'
depends_on:
minio:
condition: service_healthy
rustfs:
condition: service_healthy
environment:
MINIO_ROOT_USER: ${MINIO_ROOT_USER}
MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD}
SOURCE_ENDPOINT: http://minio:9000
TARGET_ENDPOINT: http://rustfs:9000
STORAGE_ACCESS_KEY: ${MINIO_ROOT_USER}
STORAGE_SECRET_KEY: ${MINIO_ROOT_PASSWORD}
STORAGE_BUCKET: mineseeker
volumes:
- ./docker/minio-init.sh:/minio-init.sh:ro
entrypoint: ["/bin/sh", "/minio-init.sh"]
- storage_migration_state:/state
mail:
image: boky/postfix:latest
restart: unless-stopped
@@ -157,7 +214,7 @@ services:
retries: 10
start_period: 10s
ports:
- "5452:5432"
- "${POSTGRES_PUBLISHED_PORT:-5452}:5432"
volumes:
app_var:
postgres_data:
@@ -165,3 +222,5 @@ volumes:
caddy_config:
postfix_spool:
minio_data:
rustfs_data:
storage_migration_state: