chore: move generated images and database outside the git worktree
The output/ and data/ directories lived inside this git repo. They are gitignored, so any rebuild of the directory (git clone into a recreated path, rm + clone) silently took the generated images and the SQLite database with it. On 2026-11-04 that cost a full round of regenerated images. The real data now lives in /root/apps/ai-image-data/: output/ generated images, one subdirectory per profile_name data/ ai_image.db + secret.key Bind mounts use absolute paths so the container never depends on symlink resolution. ./output and ./data remain as symlinks for backwards compatibility with existing scripts and skills. Also ignore the symlinks themselves: the directory-form rules do not match them, so git would have picked them up.
This commit is contained in:
@@ -4,8 +4,13 @@
|
||||
!.env.example
|
||||
|
||||
# Local runtime data (SQLite + 加密密钥)
|
||||
# 2026-11-04 起真身已迁到 /root/apps/ai-image-data/(git 工作树外)。
|
||||
# 这里的 data/ output/ 只保留为指向新位置的符号链接(方便老路径继续用)。
|
||||
data/
|
||||
output/
|
||||
# 符号链接本身也别提交(目录形式的规则匹配不到 symlink)
|
||||
/data
|
||||
/output
|
||||
.screenshots/
|
||||
.trae-html-share-packages/
|
||||
|
||||
|
||||
+5
-2
@@ -8,6 +8,9 @@ services:
|
||||
env_file:
|
||||
- .env
|
||||
volumes:
|
||||
- ./output:/app/output
|
||||
- ./data:/app/data
|
||||
# 生成物与数据库放在 git 工作树外(/root/apps/ai-image 是 git repo,
|
||||
# 目录一旦被 clone/rm 重建,未跟踪的生成物会一起消失 —— 2026-11-04 丢过一轮)。
|
||||
# 用绝对路径而非 ./output,避免 bind mount 跟随符号链接的歧义。
|
||||
- /root/apps/ai-image-data/output:/app/output
|
||||
- /root/apps/ai-image-data/data:/app/data
|
||||
restart: unless-stopped
|
||||
|
||||
Reference in New Issue
Block a user