add gotify data directory and option to run with other user

This commit is contained in:
Dirk Wilden 2021-02-21 11:18:02 +01:00
parent 7663ae305b
commit 4eb22b0272
3 changed files with 24 additions and 0 deletions

View file

@ -9,3 +9,8 @@ A simple server for sending and receiving messages in real-time per WebSocket. (
Set `gotify_enabled: true` in your `inventories/<your_inventory>/nas.yml` file.
The Gotify web interface can be found at http://ansible_nas_host_or_ip:2346.
Android client: [https://play.google.com/store/apps/details?id=com.github.gotify](https://play.google.com/store/apps/details?id=com.github.gotify)
iOS client: n/a
Chrome extension: n/a
Firefox extension: [https://addons.mozilla.org/en-US/firefox/addon/gotify-for-firefox/](https://addons.mozilla.org/en-US/firefox/addon/gotify-for-firefox/)

View file

@ -2,9 +2,16 @@
gotify_enabled: false
gotify_available_externally: "false"
# data directory
gotify_data_directory: "{{ docker_home }}/gotify"
# docker image to use
gotify_docker_image: gotify/server:latest
# network
gotify_port: "2346"
gotify_hostname: "gotify"
# user to run container with
gotify_user_id: "0"
gotify_group_id: "0"

View file

@ -1,4 +1,11 @@
---
- name: Create Gotify Data Directory
file:
path: "{{ item }}"
state: directory
with_items:
- "{{ gotify_data_directory }}"
- name: Gotify Docker Container
docker_container:
name: gotify
@ -8,6 +15,11 @@
- "{{ gotify_port }}:80"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
- "{{ gotify_data_directory }}:/app/data:rw"
env:
TZ: "{{ ansible_nas_timezone }}"
PUID: "{{ gotify_user_id }}"
PGID: "{{ gotify_group_id }}"
restart_policy: unless-stopped
memory: 200m
labels: