Files
refboard-ayon/docker-compose.yml
Hiren KangadandClaude Opus 4.7 76a6e462ee feat: zero-config first boot and pluggable storage backend
Two changes that drop the friction in self-hosting RefBoard so the install
story becomes "docker compose up, open the URL".

1. JWT_SECRET is now optional. On first boot the backend generates a
   64-byte random secret and persists it in the existing settings table.
   process.env.JWT_SECRET still wins when set, so ops setups that manage
   secrets out-of-band are unaffected. The prod-throws-without-env guard
   is gone (auto-generation is a strictly safer default than the previous
   hardcoded dev fallback).

2. STORAGE_BACKEND=fs|minio picks between MinIO (default, unchanged) and
   a new local-filesystem adapter. The FS adapter exposes a fake minioClient
   that mirrors the methods RefBoard calls (statObject, getObject,
   getPartialObject, listObjectsV2, putObject, removeObject(s), bucketExists,
   makeBucket), so consumers swap require('./minio') for require('./storage')
   and nothing else changes. Sidecar .mime files hold Content-Type so the
   range-aware media proxy still serves the right response headers.

examples/compose/minimal-fs.yml is the single-container variant that uses
the FS adapter. The default docker-compose.yml still spins up MinIO.

README quick-start collapses to one block (cp .env, docker compose pull,
docker compose up -d). The first user you register on the Login screen is
auto-promoted to admin, same as before.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 09:51:20 +05:30

56 lines
1.9 KiB
YAML

services:
minio:
image: minio/minio:latest
container_name: refboard-minio
command: server /data --console-address ":9001"
environment:
MINIO_ROOT_USER: ${MINIO_ACCESS_KEY:-minioadmin}
MINIO_ROOT_PASSWORD: ${MINIO_SECRET_KEY:-minioadmin}
ports:
- "9000:9000" # S3 API
- "9001:9001" # Web console
volumes:
- ./.docker-data/minio:/data
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
refboard:
image: ${REFBOARD_IMAGE:-ghcr.io/metalfinger/refboard:latest}
build: .
container_name: refboard
depends_on:
minio:
condition: service_healthy
environment:
PORT: 8000
NODE_ENV: ${NODE_ENV:-production}
JWT_SECRET: ${JWT_SECRET:?JWT_SECRET must be set in .env}
JWT_EXPIRES_IN: ${JWT_EXPIRES_IN:-7d}
DB_PATH: /app/data/refboard.db
MINIO_ENDPOINT: minio
MINIO_PORT: 9000
MINIO_USE_SSL: "false"
MINIO_ACCESS_KEY: ${MINIO_ACCESS_KEY:-minioadmin}
MINIO_SECRET_KEY: ${MINIO_SECRET_KEY:-minioadmin}
MINIO_BUCKET: ${MINIO_BUCKET:-refboard}
STORAGE_BACKEND: ${STORAGE_BACKEND:-minio}
STORAGE_DATA_DIR: ${STORAGE_DATA_DIR:-/app/data/storage}
PUBLIC_URL: ${PUBLIC_URL:-}
MAX_FILE_SIZE_MB: ${MAX_FILE_SIZE_MB:-200}
CORS_ORIGIN: ${CORS_ORIGIN:-*}
SEED_ADMIN_EMAIL: ${SEED_ADMIN_EMAIL:-}
SEED_ADMIN_PASSWORD: ${SEED_ADMIN_PASSWORD:-}
SEED_ADMIN_USERNAME: ${SEED_ADMIN_USERNAME:-}
SEED_ADMIN_DISPLAY_NAME: ${SEED_ADMIN_DISPLAY_NAME:-}
ALLOW_SELF_REGISTRATION: ${ALLOW_SELF_REGISTRATION:-false} # initial seed only; toggle lives in /admin
REFBOARD_API_KEY: ${REFBOARD_API_KEY:-}
ports:
- "8000:8000"
volumes:
- ./.docker-data/refboard:/app/data
restart: unless-stopped