Z User commited on
Commit
cbfbec3
·
1 Parent(s): af5a9e5

fix: set TZ=Asia/Shanghai for correct log timestamps

Browse files

HF Space defaults to UTC, causing 8-hour offset in log file timestamps.
- Dockerfile: ENV TZ=Asia/Shanghai + link /etc/localtime
- start.sh: export TZ as safety net for runtime

Files changed (2) hide show
  1. Dockerfile +4 -0
  2. start.sh +3 -0
Dockerfile CHANGED
@@ -1,5 +1,9 @@
1
  FROM python:3.12-slim
2
 
 
 
 
 
3
  # System deps (add build tools for node-pty native compilation)
4
  RUN apt-get update && apt-get install -y --no-install-recommends \
5
  git curl gnupg2 fontconfig make g++ python3 \
 
1
  FROM python:3.12-slim
2
 
3
+ # Fix timezone — HF Space defaults to UTC, we need Asia/Shanghai for log timestamps
4
+ ENV TZ=Asia/Shanghai
5
+ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
6
+
7
  # System deps (add build tools for node-pty native compilation)
8
  RUN apt-get update && apt-get install -y --no-install-recommends \
9
  git curl gnupg2 fontconfig make g++ python3 \
start.sh CHANGED
@@ -4,6 +4,9 @@
4
 
5
  echo "=== Hermes Bot — HuggingFace Space Startup ==="
6
 
 
 
 
7
  # Ensure persistent storage directories exist
8
  mkdir -p /data/hermes/{sessions,memories,uploads,logs,palace,skills,weixin}
9
 
 
4
 
5
  echo "=== Hermes Bot — HuggingFace Space Startup ==="
6
 
7
+ # Ensure system timezone matches config (logging timestamps use system TZ)
8
+ export TZ="${TZ:-Asia/Shanghai}"
9
+
10
  # Ensure persistent storage directories exist
11
  mkdir -p /data/hermes/{sessions,memories,uploads,logs,palace,skills,weixin}
12