From d59f68d65471addeb6b46ea1936094fa256f15a7 Mon Sep 17 00:00:00 2001 From: cnphpbb Date: Sun, 31 Aug 2025 16:58:55 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0ntfy=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E7=9A=84=E5=9F=BA=E7=A1=80=E9=85=8D=E7=BD=AE=E5=92=8C?= =?UTF-8?q?=E9=83=A8=E7=BD=B2=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加ntfy服务的Docker Compose部署配置和环境变量文件,包括镜像版本、端口映射、环境变量配置和卷挂载设置 --- ntfy/env.cfg | 2 ++ ntfy/stack.yml | 28 ++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 ntfy/env.cfg create mode 100644 ntfy/stack.yml diff --git a/ntfy/env.cfg b/ntfy/env.cfg new file mode 100644 index 0000000..180caaa --- /dev/null +++ b/ntfy/env.cfg @@ -0,0 +1,2 @@ +IMAGE_TAG=binwiederhier/ntfy:v2.14 +Volumes_Path=/data/volumes/ntfy \ No newline at end of file diff --git a/ntfy/stack.yml b/ntfy/stack.yml new file mode 100644 index 0000000..6b25988 --- /dev/null +++ b/ntfy/stack.yml @@ -0,0 +1,28 @@ +# mkdir -pv /data/volumes/ntfy/{cache,etc} +# 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 + +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_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_ATTACHMENT_CACHE_DIR=/var/lib/ntfy/attachments #设置附件缓存目录 + - NTFY_ENABLE_LOGIN=true #开启登录授权访问 + volumes: + - /etc/localtime:/etc/localtime:ro + - /etc/timezone:/etc/timezone:ro + - ${Volumes_Path}/cache:/var/cache/ntfy + - ${Volumes_Path}/etc:/etc/ntfy/ntfy.conf