nezha / Dockerfile
XJFKKK's picture
Update Dockerfile
e77c135 verified
raw
history blame contribute delete
838 Bytes
FROM ubuntu:20.04
ENV DEBIAN_FRONTEND=noninteractive
# 安装必要的依赖
RUN apt-get update && apt-get install -y \
wget \
curl \
unzip \
grep \
&& rm -rf /var/lib/apt/lists/*
# 设置环境变量,可以根据需要修改
ENV NZ_SITE_TITLE="我的哪吒监控"
# Hugging Face Spaces 默认使用 7860 端口
ENV NZ_PORT=7860
ENV NZ_HOSTPORT="xjfkkk-nezha.hf.space:443"
ENV NZ_TLS="true"
ENV NZ_LANG="zh_CN"
# 复制并运行脚本
COPY nezha.sh /nezha.sh
RUN chmod +x /nezha.sh
RUN /nezha.sh
# 确保 /data 目录具有写权限
RUN mkdir -p /data/nezha/dashboard/data && chmod -R 777 /data/nezha
# 暴露端口
EXPOSE 7860
# 设置启动命令,移除未定义的参数 -web
CMD ["/data/nezha/dashboard/app", "-c", "/data/nezha/dashboard/data/config.yaml", "-db", "/data/nezha/dashboard/data/sqlite.db"]