Files
ai-image/docker-compose.yml
T
Jack 53b2123ae9 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.
2026-11-04 23:48:01 +08:00

17 lines
575 B
YAML
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.
services:
ai-image:
build:
context: .
dockerfile: Dockerfile
ports:
- "8765:8000"
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
restart: unless-stopped