Files
deploy.stack/ntfy/stack.yml
cnphpbb 3a3ada7247 docs(ntfy): 添加环境变量注释说明
为ntfy服务的环境变量配置添加详细的中文注释,说明每个变量的用途和配置意义,便于后续维护和理解配置项。
2025-09-02 16:06:03 +08:00

36 lines
2.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.
# mkdir -pv /data/volumes/ntfy/lib
# pull:: docker compose -p ntfy --env-file ./ntfy/env.cfg -f ./ntfy/stack.yml pull
# run:: docker compose -p ntfy --env-file ./ntfy/env.cfg -f ./ntfy/stack.yml up -d
# 部署好后: docker exec -it ntfy ntfy user add --role=admin <username> 设置登录账号和密码
services:
ntfy:
image: ${IMAGE_TAG}
container_name: ntfy
#tty: true
stdin_open: true
command:
serve
restart: unless-stopped
ports:
- '5480:80'
environment:
- TZ=Asia/Shanghai # 时区设置为上海时区
- NTFY_BASE_URL=<http://ntfy:80> # ntfy服务的基础访问URL协议+主机+端口)
- NTFY_CACHE_FILE=/var/lib/ntfy/cache.db # 缓存数据的存储文件路径
- NTFY_AUTH_FILE=/var/lib/ntfy/auth.db # 授权信息(如用户认证数据)的存储文件路径
- NTFY_AUTH_DEFAULT_ACCESS=deny-all # 默认访问权限:禁止所有未授权访问
- NTFY_BEHIND_PROXY=true # 标识ntfy服务运行在代理服务器后方如Nginx等
- NTFY_ATTACHMENT_CACHE_DIR=/var/lib/ntfy/attachments # 附件资源的缓存存储目录
- NTFY_ENABLE_LOGIN=true # 启用登录功能,允许用户通过账号密码授权访问
- NTFY_WEB_PUSH_PUBLIC_KEY= <public_key> # Web推送功能的公钥用于消息加密
- NTFY_WEB_PUSH_PRIVATE_KEY= <private_key> # Web推送功能的私钥与公钥配对用于解密/签名)
- NTFY_WEB_PUSH_FILE=/var/lib/ntfy/webpush.db # Web推送相关的数据存储文件路径
- NTFY_WEB_PUSH_EMAIL_ADDRESS= <email> # Web推送关联的邮件地址用于通知等场景
- NTFY_ENABLE_SIGNUP=false # 禁用用户注册功能,阻止新用户自主创建账号
- NTFY_ENABLE_METRICS=true # 启用指标收集功能,用于监控和分析服务运行状态
volumes:
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
- ${Volumes_Path}/lib:/var/lib/ntfy