From ae3163c5b1c559442464f6c21d789a20f474252b Mon Sep 17 00:00:00 2001 From: ksurl Date: Thu, 2 Jun 2022 13:35:49 -0700 Subject: [PATCH] add tzdata to image and use env for docker timezone --- Dockerfile | 2 ++ docker-compose.yml | 5 +++-- docs/install.md | 9 +++++---- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6916cabc..9a5e2b30 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,5 +3,7 @@ MAINTAINER Philipp C. Heckel COPY ntfy /usr/bin +RUN apk add --no-cache tzdata + EXPOSE 80/tcp ENTRYPOINT ["ntfy"] diff --git a/docker-compose.yml b/docker-compose.yml index 2ab66a8c..d39492e8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,11 +5,12 @@ services: container_name: ntfy command: - serve - user: UID:GID # optional. Set custom user/group or uid/gid + environment: + - TZ=UTC # optional: Change to your desired timezone + user: UID:GID # optional: Set custom user/group or uid/gid volumes: - /var/cache/ntfy:/var/cache/ntfy - /etc/ntfy:/etc/ntfy - - /etc/localtime:/etc/localtime:ro ports: - 80:80 restart: unless-stopped diff --git a/docs/install.md b/docs/install.md index 8fe43baa..092c9a4b 100644 --- a/docs/install.md +++ b/docs/install.md @@ -239,11 +239,11 @@ docker run \ serve ``` -With other config options, host-matched timezone, and non-root user (configured via `/etc/ntfy/server.yml`, see [configuration](config.md) for details): +With other config options, timezone, and non-root user (configured via `/etc/ntfy/server.yml`, see [configuration](config.md) for details): ```bash docker run \ -v /etc/ntfy:/etc/ntfy \ - -v /etc/localtime:/etc/localtime:ro \ + -e TZ=UTC \ -p 80:80 \ -u UID:GID \ -it \ @@ -261,11 +261,12 @@ services: container_name: ntfy command: - serve - user: UID:GID # optional. replace with your own user/group or uid/gid + environment: + - TZ=UTC # optional: set desired timezone + user: UID:GID # optional: replace with your own user/group or uid/gid volumes: - /var/cache/ntfy:/var/cache/ntfy - /etc/ntfy:/etc/ntfy - - /etc/localtime:/etc/localtime:ro # set timezone to match host ports: - 80:80 restart: unless-stopped