XJFKKK commited on
Commit
803121e
·
verified ·
1 Parent(s): ac6db14

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -4
Dockerfile CHANGED
@@ -12,7 +12,7 @@ RUN apt-get update && apt-get install -y \
12
 
13
  # 设置环境变量,可以根据需要修改
14
  ENV NZ_SITE_TITLE="我的哪吒监控"
15
- ENV NZ_PORT=8008
16
  ENV NZ_HOSTPORT="example.com:443"
17
  ENV NZ_TLS="true"
18
  ENV NZ_LANG="zh_CN"
@@ -22,8 +22,11 @@ COPY nezha.sh /nezha.sh
22
  RUN chmod +x /nezha.sh
23
  RUN /nezha.sh
24
 
 
 
 
25
  # 暴露端口
26
- EXPOSE 8008
27
 
28
- # 设置启动命令
29
- CMD ["/opt/nezha/dashboard/app", "-config=/opt/nezha/dashboard/data/config.yaml", "-web"]
 
12
 
13
  # 设置环境变量,可以根据需要修改
14
  ENV NZ_SITE_TITLE="我的哪吒监控"
15
+ ENV NZ_PORT=7860 # Hugging Face Spaces 默认使用 7860 端口
16
  ENV NZ_HOSTPORT="example.com:443"
17
  ENV NZ_TLS="true"
18
  ENV NZ_LANG="zh_CN"
 
22
  RUN chmod +x /nezha.sh
23
  RUN /nezha.sh
24
 
25
+ # 确保 /data 目录具有写权限
26
+ RUN mkdir -p /data/nezha/dashboard/data && chmod -R 777 /data/nezha
27
+
28
  # 暴露端口
29
+ EXPOSE 7860
30
 
31
+ # 设置启动命令,使用正确的参数
32
+ CMD ["/data/nezha/dashboard/app", "-c", "/data/nezha/dashboard/data/config.yaml", "-db", "/data/nezha/dashboard/data/sqlite.db", "-web"]