chore: keep generated images inside the project as real directories
The absolute-path + symlink layout added earlier today is awkward to redeploy against: after a fresh clone the symlinks point at nothing and compose quietly creates empty directories in their place, so the service comes up healthy with no history. /root/apps/ holds services only, so the images and the SQLite database live in the project again as ./output and ./data, bind-mounted with relative paths. Backups are handled by a separate hook that copies to /root/backup_files/ai-image/, which is not part of /root/apps/. Both directories stay gitignored.
This commit is contained in:
+8
-5
@@ -8,9 +8,12 @@ services:
|
||||
env_file:
|
||||
- .env
|
||||
volumes:
|
||||
# 生成物与数据库放在 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
|
||||
# 生成物与数据库用项目内相对路径(2026-11-04 还原)。
|
||||
# 不用绝对路径也不用符号链接:符号链接在重新 clone/rm -rf 重建后
|
||||
# 会指向空气,compose 还会静默创建一个空目录。
|
||||
# 注意:/root/apps/ai-image/output 与 /root/apps/ai-image/data 是本服务的
|
||||
# 生成物目录,删项目之前先备份(备份脚本见 ruantang profile 的
|
||||
# backup-ai-image-output.sh,落到 /root/backup_files/ai-image/)。
|
||||
- ./output:/app/output
|
||||
- ./data:/app/data
|
||||
restart: unless-stopped
|
||||
|
||||
Reference in New Issue
Block a user