From cd9fd14cfebd8453771ce46222c6662b10ee93fa Mon Sep 17 00:00:00 2001 From: Marco Kundt Date: Mon, 12 Apr 2021 14:40:45 +0200 Subject: [PATCH] set the right timezone inside containers --- docker-compose.yml | 15 +++++++++++---- env.example | 6 ++++++ 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 53c1946..593ff6e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,8 +9,11 @@ services: restart: unless-stopped volumes: - ${POSTGRES_DATA_PATH}:/var/lib/postgresql/data - - /etc/localtime:/etc/localtime:ro environment: + # timezone inside container + - TZ + + # necessay Postgres options/variables - POSTGRES_USER - POSTGRES_PASSWORD - POSTGRES_DB @@ -24,7 +27,9 @@ services: - ${NGINX_DHPARAMS_FILE}:/dhparams4096.pem - ${CERT_PATH}:/cert.pem:ro - ${KEY_PATH}:/key.pem:ro - - /etc/localtime:/etc/localtime:ro + environment: + # timezone inside container + - TZ ports: - ${HTTPS_PORT}:443 - ${HTTP_PORT}:80 @@ -42,9 +47,11 @@ services: - ${MATTERMOST_LOGS_PATH}:/mattermost/logs:rw - ${MATTERMOST_PLUGINS_PATH}:/mattermost/plugins:rw - ${MATTERMOST_CLIENT_PLUGINS_PATH}:/mattermost/client-plugins:rw - - /etc/localtime:/etc/localtime:ro environment: - # necessary options/variables (see env.example) + # timezone inside container + - TZ + + # necessary Mattermost options/variables (see env.example) - MM_SQLSETTINGS_DRIVERNAME - MM_SQLSETTINGS_DATASOURCE diff --git a/env.example b/env.example index 398b071..6580776 100644 --- a/env.example +++ b/env.example @@ -1,3 +1,9 @@ +# Container settings +## Timezone inside the containers. The value needs to be in the form 'Europe/Berlin'. +## A list of these tz database names can be looked up at Wikipedia +## https://en.wikipedia.org/wiki/List_of_tz_database_time_zones +TZ=UTC + # Postrges settings ## Documentation for this image and available settings can be found on hub.docker.com ## https://hub.docker.com/_/postgres