Files
termi-blog/deploy/docker/.env.example
limitcool cf00dc5e8e
Some checks failed
docker-images / resolve-build-targets (push) Successful in 6s
ui-regression / playwright-regression (push) Successful in 4m43s
docker-images / build-and-push (admin) (push) Successful in 42s
docker-images / submit-indexnow (push) Has been cancelled
docker-images / build-and-push (frontend) (push) Has been cancelled
docker-images / build-and-push (backend) (push) Has started running
feat: 添加 AI 索引重建功能,优化相关 API 和工作流,增强内存管理配置
2026-04-03 15:48:33 +08:00

78 lines
3.2 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Compose runtime variables (package image deployment)
BACKEND_PORT=5150
FRONTEND_PORT=4321
ADMIN_PORT=4322
# 建议在小内存主机上给每个服务设置明确上限,避免 backend 在 AI 重建索引时
# 把整台主机拖进 swap 抖动。默认值与 compose.package.yml 保持一致。
BACKEND_MEMORY_LIMIT=768m
BACKEND_MEMORY_SWAP_LIMIT=768m
BACKEND_WORKER_MEMORY_LIMIT=512m
BACKEND_WORKER_MEMORY_SWAP_LIMIT=512m
FRONTEND_MEMORY_LIMIT=256m
FRONTEND_MEMORY_SWAP_LIMIT=256m
ADMIN_MEMORY_LIMIT=128m
ADMIN_MEMORY_SWAP_LIMIT=128m
# frontend SSR 服务端访问 backend 用这个内部地址compose 默认可直接使用)
INTERNAL_API_BASE_URL=http://backend:5150/api
# 浏览器里评论 / AI 问答 / 搜索等请求优先读取这个公开 API 地址。
# 如果留空frontend 会在生产环境按“当前访问主机 + :5150/api”回退。
# 走反向代理时建议显式设置,例如:
# PUBLIC_API_BASE_URL=https://your-frontend.example.com/api
PUBLIC_API_BASE_URL=
# 前台 /_img 图片优化端点默认只放行“当前站点同域”图片。
# 如果你的文章封面或对象存储图片来自额外 CDN / R2 公网域名,
# 可以在这里填逗号分隔的 host 列表,例如:
# PUBLIC_IMAGE_ALLOWED_HOSTS=cdn.example.com,pub-xxxx.r2.dev
PUBLIC_IMAGE_ALLOWED_HOSTS=
# 如果你要启用 IndexNow 自动提交,请填写一个你自己的 key。
# frontend 会在 /indexnow-key.txt 暴露这个 key配合 `pnpm indexnow:submit` 使用。
INDEXNOW_KEY=
# admin 浏览器请求 backend API 优先读取这个公开地址。
# 如果留空admin 会在生产环境按“当前访问主机 + :5150”回退。
# 如果你采用推荐方案admin 域名同域转发 /api 到 backend
# 建议直接填后台域名 origin例如
# ADMIN_API_BASE_URL=https://admin.example.com
ADMIN_API_BASE_URL=
# admin 页面里的“打开前台 / AI 问答 / 文章预览”链接优先读取这个运行时变量。
# 如果你不是直接把前台暴露在 http://<host>:4321而是走独立域名 / HTTPS / 反向代理,
# 建议设置为正式前台地址,例如:
# ADMIN_FRONTEND_BASE_URL=https://your-frontend.example.com
ADMIN_FRONTEND_BASE_URL=
APP_BASE_URL=http://localhost:5150
DATABASE_URL=postgres://<user>:<password>@<external-db-host>:5432/termi_api
REDIS_URL=redis://<external-redis-host>:6379
JWT_SECRET=change-me-before-production
JWT_EXPIRATION_SECONDS=604800
RUST_LOG=info
# 邮件确认 / 通知投递需要 SMTP
SMTP_ENABLE=false
SMTP_HOST=localhost
SMTP_PORT=1025
SMTP_SECURE=false
SMTP_USER=
SMTP_PASSWORD=
SMTP_HELLO_NAME=
# 启用 TinyAuth / Pocket ID / Caddy forward_auth 时建议:
# - TERMI_ADMIN_TRUST_PROXY_AUTH=true
# - TERMI_ADMIN_LOCAL_LOGIN_ENABLED=false
# - 额外配置一个共享密钥,并在 Caddy 转发 /api 到 backend 时附带:
# X-Termi-Proxy-Secret: {$TERMI_ADMIN_PROXY_SHARED_SECRET}
TERMI_ADMIN_TRUST_PROXY_AUTH=false
TERMI_ADMIN_LOCAL_LOGIN_ENABLED=true
TERMI_ADMIN_PROXY_SHARED_SECRET=
# Optional: override package tags if needed
BACKEND_IMAGE=git.init.cool/cool/termi-astro-backend:latest
FRONTEND_IMAGE=git.init.cool/cool/termi-astro-frontend:latest
ADMIN_IMAGE=git.init.cool/cool/termi-astro-admin:latest