Files
homelab/cat-bodhi/compose.yml
T

72 lines
3.0 KiB
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:
cat-bodhi:
build:
context: .
# GPU 加速:取消下面注释(需先安装 nvidia-container-toolkit
# args:
# TORCH_INDEX: https://download.pytorch.org/whl/cu126
container_name: cat-bodhi
restart: unless-stopped
env_file:
- .env
environment:
- PORT=8080
- SPRITE_SEG_ROOT=/opt/sprite_alpha_seg_pytorch
- SPRITE_SEG_PYTHON=/usr/local/bin/python
- SPRITE_SEG_CHECKPOINT=/opt/sprite_alpha_seg_pytorch/checkpoints/unet_sprite_ft.pt
- SPRITE_SEG_OUT_DIR=/opt/sprite_alpha_seg_pytorch/outputs/cat_match
volumes:
# 模型文件目录(需要手动放入 infer_spritesheet_hybrid.py + checkpoints/
- ./sprite_alpha_seg_pytorch:/opt/sprite_alpha_seg_pytorch:rw
# AI 生成图片持久化(可选,不挂载则容器重启后丢失)
- ./data/assets-ai:/app/assets/ai:rw
networks:
- homelab_net
# GPU 支持:取消下面注释(需先安装 nvidia-container-toolkit
# deploy:
# resources:
# reservations:
# devices:
# - driver: nvidia
# count: 1
# capabilities: [gpu]
labels:
# ========== Traefik ==========
- "traefik.enable=true"
# HTTPS router (cert management)
- "traefik.http.routers.cat-bodhi.rule=Host(`cat-bodhi.xiteng.site`)"
- "traefik.http.routers.cat-bodhi.entrypoints=websecure"
- "traefik.http.routers.cat-bodhi.tls=true"
- "traefik.http.routers.cat-bodhi.tls.certresolver=cfresolver"
- "traefik.http.services.cat-bodhi.loadbalancer.server.port=8080"
# HTTP router (Cloudflare Tunnel ingress)
- "traefik.http.routers.cat-bodhi-http.rule=Host(`cat-bodhi.xiteng.site`)"
- "traefik.http.routers.cat-bodhi-http.service=cat-bodhi"
- "traefik.http.routers.cat-bodhi-http.entrypoints=web"
- "xiteng.site.cache.cat-bodhi.enabled=true"
- "xiteng.site.cache.cat-bodhi.routers=cat-bodhi,cat-bodhi-http"
- "xiteng.site.cache.cat-bodhi.paths=/assets/,/data/assets-ai/"
- "xiteng.site.cache.cat-bodhi.edge-ttl=604800"
- "xiteng.site.cache.cat-bodhi.stale-while-revalidate=86400"
- "xiteng.site.component.cat-bodhi.enabled=true"
- "xiteng.site.component.cat-bodhi.name=猫猫盘珠日记"
- "xiteng.site.component.cat-bodhi.description=文玩手串与猫咪主题游戏,以及 Sprite 抠图导入工具。"
- "xiteng.site.component.cat-bodhi.section=services"
- "xiteng.site.component.cat-bodhi.category=作品与实验"
- "xiteng.site.component.cat-bodhi.url=https://cat-bodhi.xiteng.site"
- "xiteng.site.component.cat-bodhi.access=public"
- "xiteng.site.component.cat-bodhi.access-label=无需登录"
- "xiteng.site.component.cat-bodhi.icon=猫"
- "xiteng.site.component.cat-bodhi.accent=yellow"
- "xiteng.site.component.cat-bodhi.order=300"
- "xiteng.site.component.cat-bodhi.navigation=new-tab"
- "xiteng.site.component.cat-bodhi.portal-link=embedded"
networks:
homelab_net:
external: true