2023-11-06 10:39:27 +08:00
|
|
|
# {{ ansible_managed }}
|
|
|
|
services:
|
|
|
|
ntfy:
|
|
|
|
image: binwiederhier/ntfy:latest
|
|
|
|
container_name: ntfy
|
|
|
|
command:
|
|
|
|
- serve
|
|
|
|
security_opt:
|
|
|
|
- no-new-privileges
|
|
|
|
#user: UID:GID # optional: replace with your own user/group or uid/gid
|
|
|
|
environment:
|
|
|
|
- PUID=1000
|
|
|
|
- PGID=1000
|
|
|
|
- TZ=Asia/Singapore
|
|
|
|
- NTFY_BASE_URL=https://nt.opnxng.com
|
|
|
|
- NTFY_AUTH_DEFAULT_ACCESS=deny-all
|
|
|
|
- NTFY_CACHE_DURATION=72h
|
|
|
|
- NTFY_AUTH_FILE=/var/lib/ntfy/user.db
|
|
|
|
- NTFY_CACHE_FILE=/var/cache/ntfy/cache.db
|
|
|
|
volumes:
|
|
|
|
- {{ docker_dir }}/ntfy/cache.db:/var/cache/ntfy/cache.db
|
|
|
|
- {{ docker_dir }}/ntfy/user.db:/var/lib/ntfy/user.db
|
|
|
|
restart: unless-stopped
|
|
|
|
ports:
|
2024-08-11 21:41:34 +08:00
|
|
|
- 8894:80
|
2023-11-06 10:39:27 +08:00
|
|
|
healthcheck: # optional: remember to adapt the host:port to your environment
|
|
|
|
test: ["CMD-SHELL", "wget -q --tries=1 http://localhost:80/v1/health -O - | grep -Eo '\"healthy\"\\s*:\\s*true' || exit 1"]
|
|
|
|
interval: 60s
|
|
|
|
timeout: 10s
|
|
|
|
retries: 3
|
|
|
|
start_period: 40s
|
|
|
|
networks:
|
2023-11-10 05:28:42 +08:00
|
|
|
- ntfy
|
2023-11-06 10:39:27 +08:00
|
|
|
|
|
|
|
networks:
|
2023-11-10 05:28:42 +08:00
|
|
|
ntfy:
|
|
|
|
name: ntfy
|
2023-11-06 10:39:27 +08:00
|
|
|
|
|
|
|
# touch {{ docker_dir }}/ntfy/cache.db && touch {{ docker_dir }}/ntfy/user.db
|
|
|
|
# docker exec -it ntfy ntfy user add --role=admin opnxng
|
2024-10-05 11:47:43 +08:00
|
|
|
# docker exec -it ntfy ntfy token add opnxng
|