Bundle extension (upload hook + API endpoint + admin module) that warms Directus image transform cache in-process with an explicit acceptFormat, so the generated file matches the browser's cache key byte-for-byte. - resumable, window-aware backfill with progress + cancel - system + custom presets, effective-format reporting, shadow warnings - storage breakdown (previews vs originals), human-readable API fields - diagnostics: resolve-plan prediction, per-file generate, ops ring buffer - isolated dev/staging compose stack + deploy/rollback scripts Verified on Directus 11.17.4: 40/40 tests, hash-match gate passed, idempotent backfill, custom fixed-format presets, error surfacing.
51 lines
1.2 KiB
YAML
51 lines
1.2 KiB
YAML
name: image-previews-dev
|
|
|
|
services:
|
|
db:
|
|
image: postgres:16-alpine
|
|
environment:
|
|
POSTGRES_USER: directus
|
|
POSTGRES_PASSWORD: directus
|
|
POSTGRES_DB: directus
|
|
volumes:
|
|
- db-data:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U directus"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 20
|
|
|
|
directus:
|
|
image: directus/directus:11.17.4
|
|
ports:
|
|
- "8057:8055"
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
environment:
|
|
KEY: dev-key
|
|
SECRET: dev-secret
|
|
ADMIN_EMAIL: admin@example.com
|
|
ADMIN_PASSWORD: admin12345
|
|
DB_CLIENT: pg
|
|
DB_HOST: db
|
|
DB_PORT: "5432"
|
|
DB_DATABASE: directus
|
|
DB_USER: directus
|
|
DB_PASSWORD: directus
|
|
STORAGE_LOCATIONS: local
|
|
STORAGE_LOCAL_ROOT: /directus/uploads
|
|
EXTENSIONS_AUTO_RELOAD: "true"
|
|
CACHE_ENABLED: "false"
|
|
RATE_LIMITER_ENABLED: "false"
|
|
ASSETS_TRANSFORM_MAX_CONCURRENT: "2"
|
|
IMAGE_PREVIEWS_ENABLED: "true"
|
|
IMAGE_PREVIEWS_CONCURRENCY: "1"
|
|
LOG_LEVEL: info
|
|
volumes:
|
|
- uploads:/directus/uploads
|
|
- ./extension:/directus/extensions/directus-extension-generate-image-previews
|
|
|
|
volumes:
|
|
db-data:
|
|
uploads:
|