0
0
opnxng-deploy-playbook/templates/compose/ntfy.yaml.j2
2024-06-06 23:52:16 +08:00

42 lines
1.3 KiB
Django/Jinja

# {{ ansible_managed }}
version: '3.3'
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:
- '8894:80'
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:
- ntfy
networks:
ntfy:
name: ntfy
# touch {{ docker_dir }}/ntfy/cache.db && touch {{ docker_dir }}/ntfy/user.db
# docker exec -it ntfy ntfy user add --role=admin opnxng
# docker exec -it ntfy ntfy token add opnxng