feat: support serverless deployment (Vercel / Cloudflare Pages)
- Replace bcrypt (native) with bcryptjs (pure JS) — no native build on serverless - Storage abstraction (lib/storage.js): local uploads/ for traditional deploy, S3-compatible (R2/MinIO/S3 via aws4fetch) for serverless - DB pool auto-adapts to serverless (single connection, rotation, timeouts) - next.config.js: standalone output only when DOCKER=1 (serverless skips it) - Docs: serverless deployment section in README, S3 env vars in .env.example
This commit is contained in:
1 parent
83239d498e
commit
ec50efea89
15 files changed
+163
-143
No files matched your search
@@ -10,3 +10,11 @@ JWT_SECRET=forumlify-secret-key-change-me-in-production
|
||||
# 可选:监听端口/地址(也可在 config.js 中设置 SERVER_PORT / SERVER_HOST)
|
||||
# PORT=3000
|
||||
# HOST=0.0.0.0
|
||||
|
||||
# ===== Serverless / 对象存储(可选,仅 serverless 部署需要)=====
|
||||
# S3_ENDPOINT=https://xxx.r2.cloudflarestorage.com
|
||||
# S3_BUCKET=forumlify
|
||||
# S3_REGION=auto
|
||||
# S3_ACCESS_KEY_ID=
|
||||
# S3_SECRET_ACCESS_KEY=
|
||||
# S3_PUBLIC_URL=https://cdn.example.com
|
||||
Reference in new issue
Block a user