Simford.Dong commited on
Commit ·
57df6d3
1
Parent(s): 195797b
Symlink ~/.hermes-web-ui -> /data/.hermes-web-ui for persistence
Browse filesMatches the existing ~/.hermes pattern. App writes to ~/hermes-web-ui
which resolves through the symlink to /data/.hermes-web-ui (persistent
volume). Backup path stays at /data/.hermes-web-ui.
- Dockerfile +2 -1
- src/data_sync.py +1 -1
Dockerfile
CHANGED
|
@@ -103,12 +103,13 @@ COPY entrypoint.sh /app/
|
|
| 103 |
COPY config/config.yaml /data/.hermes/config.yaml
|
| 104 |
|
| 105 |
# 创建数据目录
|
| 106 |
-
RUN mkdir -p /data/.hermes /data/.hermes-web-ui
|
| 107 |
chmod +x /app/entrypoint.sh
|
| 108 |
|
| 109 |
# 设置非 root 用户(Hugging Face Spaces 要求)
|
| 110 |
RUN useradd -m -u 1000 appuser && \
|
| 111 |
ln -sf /data/.hermes /home/appuser/.hermes && \
|
|
|
|
| 112 |
mkdir -p /home/appuser/.cache && \
|
| 113 |
chown -R appuser:appuser /data /opt/hermes-web-ui /app /home/appuser && \
|
| 114 |
chown appuser:appuser /usr/local/bin
|
|
|
|
| 103 |
COPY config/config.yaml /data/.hermes/config.yaml
|
| 104 |
|
| 105 |
# 创建数据目录
|
| 106 |
+
RUN mkdir -p /data/.hermes /data/.hermes-web-ui/logs /app/logs && \
|
| 107 |
chmod +x /app/entrypoint.sh
|
| 108 |
|
| 109 |
# 设置非 root 用户(Hugging Face Spaces 要求)
|
| 110 |
RUN useradd -m -u 1000 appuser && \
|
| 111 |
ln -sf /data/.hermes /home/appuser/.hermes && \
|
| 112 |
+
ln -sf /data/.hermes-web-ui /home/appuser/.hermes-web-ui && \
|
| 113 |
mkdir -p /home/appuser/.cache && \
|
| 114 |
chown -R appuser:appuser /data /opt/hermes-web-ui /app /home/appuser && \
|
| 115 |
chown appuser:appuser /usr/local/bin
|
src/data_sync.py
CHANGED
|
@@ -57,7 +57,7 @@ class DatasetManager:
|
|
| 57 |
'state_db': {'path': self.hermes_home / 'state.db', 'skip_backup': False},
|
| 58 |
'logs': {'path': self.hermes_home / 'logs', 'skip_backup': True}, # 日志大且不重要
|
| 59 |
'cron': {'path': self.hermes_home / 'cron', 'skip_backup': False},
|
| 60 |
-
'webui_dir': {'path': Path('/
|
| 61 |
'image_cache': {'path': self.hermes_home / 'image_cache', 'skip_backup': True}, # 图片缓存大
|
| 62 |
'baoyu_skills': {'path': Path('/home/appuser/.baoyu-skills'), 'skip_backup': False},
|
| 63 |
'weixin': {'path': self.hermes_home / 'weixin', 'skip_backup': False},
|
|
|
|
| 57 |
'state_db': {'path': self.hermes_home / 'state.db', 'skip_backup': False},
|
| 58 |
'logs': {'path': self.hermes_home / 'logs', 'skip_backup': True}, # 日志大且不重要
|
| 59 |
'cron': {'path': self.hermes_home / 'cron', 'skip_backup': False},
|
| 60 |
+
'webui_dir': {'path': Path('/data/.hermes-web-ui'), 'skip_backup': False},
|
| 61 |
'image_cache': {'path': self.hermes_home / 'image_cache', 'skip_backup': True}, # 图片缓存大
|
| 62 |
'baoyu_skills': {'path': Path('/home/appuser/.baoyu-skills'), 'skip_backup': False},
|
| 63 |
'weixin': {'path': self.hermes_home / 'weixin', 'skip_backup': False},
|