From 430f985fca098bdf364e74d118f864f9c06cfbf4 Mon Sep 17 00:00:00 2001
From: ksurl <ksurl@users.noreply.github.com>
Date: Wed, 1 Jun 2022 16:49:08 -0700
Subject: [PATCH 1/3] update docker docs

---
 docker-compose.yml | 14 ++++++++++++++
 docs/install.md    |  6 ++++--
 2 files changed, 18 insertions(+), 2 deletions(-)
 create mode 100644 docker-compose.yml

diff --git a/docker-compose.yml b/docker-compose.yml
new file mode 100644
index 00000000..365f25da
--- /dev/null
+++ b/docker-compose.yml
@@ -0,0 +1,14 @@
+version: "2.1"
+services:
+  ntfy:
+    image: binwiederhier/ntfy
+    container_name: ntfy
+    command:
+      - serve
+    volumes:
+      - /var/cache/ntfy:/var/cache/ntfy
+      - /etc/ntfy:/etc/ntfy
+    ports:
+      - 80:80
+    restart: unless-stopped
+
diff --git a/docs/install.md b/docs/install.md
index 231b4306..ed741231 100644
--- a/docs/install.md
+++ b/docs/install.md
@@ -239,17 +239,18 @@ docker run \
     serve
 ```
 
-With other config options (configured via `/etc/ntfy/server.yml`, see [configuration](config.md) for details):
+With other config options and non-root user (configured via `/etc/ntfy/server.yml`, see [configuration](config.md) for details):
 ```bash
 docker run \
   -v /etc/ntfy:/etc/ntfy \
   -p 80:80 \
+  -u UID:GID \
   -it \
   binwiederhier/ntfy \
   serve
 ```
 
-Using docker-compose:
+Using docker-compose with non-root user:
 ```yaml
 version: "2.1"
 
@@ -259,6 +260,7 @@ services:
     container_name: ntfy
     command:
       - serve
+    user: UID:GID # optional. replace with your own user/group or uid/gid
     volumes:
       - /var/cache/ntfy:/var/cache/ntfy
       - /etc/ntfy:/etc/ntfy

From a898a2ebe832091ba489fe63c0a1d43e10d55297 Mon Sep 17 00:00:00 2001
From: ksurl <ksurl@users.noreply.github.com>
Date: Wed, 1 Jun 2022 16:50:42 -0700
Subject: [PATCH 2/3] add user to compose file

---
 docker-compose.yml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/docker-compose.yml b/docker-compose.yml
index 365f25da..d4841bc0 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -5,6 +5,7 @@ services:
     container_name: ntfy
     command:
       - serve
+    user: UID:GID # optional. Set custom user/group or uid/gid
     volumes:
       - /var/cache/ntfy:/var/cache/ntfy
       - /etc/ntfy:/etc/ntfy

From 732537eabae3e3a4124316ba70fd76283177bbf4 Mon Sep 17 00:00:00 2001
From: ksurl <ksurl@users.noreply.github.com>
Date: Wed, 1 Jun 2022 16:52:37 -0700
Subject: [PATCH 3/3] add chown warning

---
 docs/install.md | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/docs/install.md b/docs/install.md
index ed741231..595bbd9f 100644
--- a/docs/install.md
+++ b/docs/install.md
@@ -269,6 +269,8 @@ services:
     restart: unless-stopped
 ```
 
+If using a non-root user when running the docker version, be sure to chown the server.yml, user.db, and cache.db files to the same uid/gid.
+
 Alternatively, you may wish to build a customized Docker image that can be run with fewer command-line arguments and without delivering the configuration file separately.
 ```
 FROM binwiederhier/ntfy