From eca6f01a61437506f60f3debfff2413bcd073c6f Mon Sep 17 00:00:00 2001 From: Manuel Debic Date: Tue, 31 Dec 2024 13:24:13 +0000 Subject: [PATCH] Add configurable system time zone --- Dockerfile | 5 +++++ docker-compose.base.yml | 3 +++ example.env | 3 +++ 3 files changed, 11 insertions(+) diff --git a/Dockerfile b/Dockerfile index 08b0ba8..328b887 100644 --- a/Dockerfile +++ b/Dockerfile @@ -41,6 +41,11 @@ RUN apt-get update \ && apt-get install --no-install-recommends -y \ postgresql-client-17 +# Install tzdata and configure timezone +ARG SYSTEM_TIME_ZONE +RUN apt-get install -y tzdata && \ + ln -fs /usr/share/zoneinfo/${SYSTEM_TIME_ZONE} /etc/localtime && \ + dpkg-reconfigure -f noninteractive tzdata # `builder-base` stage is used to build deps + create our virtual environment FROM python-base AS builder-base diff --git a/docker-compose.base.yml b/docker-compose.base.yml index 5c3b432..0a9b7ca 100644 --- a/docker-compose.base.yml +++ b/docker-compose.base.yml @@ -24,6 +24,9 @@ x-app: &default-app SUPPORT_EMAIL: ${SUPPORT_EMAIL:?} TOKEN_AUTHENTICATION_SALT: ${TOKEN_AUTHENTICATION_SALT:?} USER_TIME_ZONE: ${USER_TIME_ZONE:?} + build: + args: + SYSTEM_TIME_ZONE: ${SYSTEM_TIME_ZONE:-Etc/UTC} services: # We have to to define the init servce in base (even if we don't use it diff --git a/example.env b/example.env index 321717b..50ac4b4 100644 --- a/example.env +++ b/example.env @@ -75,6 +75,9 @@ SSL_CHAIN_FILE="./chain.pem" # The timezone that the web interface uses. USER_TIME_ZONE="Europe/Berlin" +# Optional system timezone (for example used in docker logging), defaults to UTC +SYSTEM_TIME_ZONE= + # An optional name of the stack (or compose project in development). # When not set it defaults to the project name with suffix "_dev" resp. "_prod". # For ADIT "adit_dev" and "adit_prod". For RADIS "radis_dev" and "radis_prod".