Migrate ntfy to network-services (.121)
This commit is contained in:
parent
17450c4b65
commit
d8b21df92b
2 changed files with 72 additions and 0 deletions
28
compose-files/network-services/ntfy/docker-compose.yml
Normal file
28
compose-files/network-services/ntfy/docker-compose.yml
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
services:
|
||||||
|
ntfy:
|
||||||
|
image: binwiederhier/ntfy:latest
|
||||||
|
container_name: ntfy
|
||||||
|
command: serve
|
||||||
|
environment:
|
||||||
|
- NTFY_BASE_URL=https://ntfy.3ddbrewery.com
|
||||||
|
- NTFY_BEHIND_PROXY=true
|
||||||
|
volumes:
|
||||||
|
- ./data:/var/lib/ntfy
|
||||||
|
- ./cache:/var/cache/ntfy
|
||||||
|
ports:
|
||||||
|
- "6741:80"
|
||||||
|
restart: unless-stopped
|
||||||
|
networks:
|
||||||
|
- proxy
|
||||||
|
deploy:
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
memory: 256M
|
||||||
|
cpus: '0.5'
|
||||||
|
labels:
|
||||||
|
- "autoheal=true"
|
||||||
|
- "com.centurylinklabs.watchtower.enable=true"
|
||||||
|
|
||||||
|
networks:
|
||||||
|
proxy:
|
||||||
|
external: true
|
||||||
44
playbooks/deploy-ntfy.yml
Normal file
44
playbooks/deploy-ntfy.yml
Normal file
|
|
@ -0,0 +1,44 @@
|
||||||
|
---
|
||||||
|
- name: Deploy ntfy to network-services
|
||||||
|
hosts: network-services
|
||||||
|
vars:
|
||||||
|
service_name: ntfy
|
||||||
|
service_dir: /home/docker/appdata/{{ service_name }}
|
||||||
|
compose_src: "{{ playbook_dir }}/../compose-files/network-services/{{ service_name }}"
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Create service directory
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: "{{ service_dir }}"
|
||||||
|
state: directory
|
||||||
|
mode: '0755'
|
||||||
|
|
||||||
|
- name: Create data subdirectory
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: "{{ service_dir }}/data"
|
||||||
|
state: directory
|
||||||
|
mode: '0755'
|
||||||
|
|
||||||
|
- name: Create cache subdirectory
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: "{{ service_dir }}/cache"
|
||||||
|
state: directory
|
||||||
|
mode: '0755'
|
||||||
|
|
||||||
|
- name: Copy docker-compose.yml
|
||||||
|
ansible.builtin.copy:
|
||||||
|
src: "{{ compose_src }}/docker-compose.yml"
|
||||||
|
dest: "{{ service_dir }}/docker-compose.yml"
|
||||||
|
mode: '0644'
|
||||||
|
|
||||||
|
- name: Pull latest image
|
||||||
|
community.docker.docker_image:
|
||||||
|
name: binwiederhier/ntfy:latest
|
||||||
|
source: pull
|
||||||
|
force_source: yes
|
||||||
|
|
||||||
|
- name: Deploy container
|
||||||
|
community.docker.docker_compose_v2:
|
||||||
|
project_src: "{{ service_dir }}"
|
||||||
|
state: present
|
||||||
|
pull: missing
|
||||||
Loading…
Reference in a new issue