All services: pass TZ to a container only when its image uses it - #357
Merged
Merged
Conversation
The service template defines TZ=Europe/Amsterdam in .env with a link to
the list of time zones, and passes it on as TZ=${TZ}. A few services
did not follow it.
- Dockge, NewWallpaperWhoDis, Radicale: add the TZ block to .env.
- Open WebUI, Tandoor, RustDesk Server: use the template comment on the
TZ line.
- Gramps Web, Mealie: read TZ from .env instead of a fixed
Europe/Amsterdam in compose.yaml.
Paperless, Picard, and Posterizarr have the same fixed value. #329
already fixes those.
Every .env defines TZ, but 31 app containers never received it, and a
few received it without using it. Each image was started with
TZ=Asia/Tokyo to see whether a process inside reports Japan time.
Add TZ=${TZ} to the app container of 28 services whose image uses it:
Arcane, Booklore, Coder, ConvertX, copyparty, Dockge, Dockhand, Docmost,
Dozzle, EspoCRM, FossFLOW, Glance, Gotify, Homepage, Memos, Miniflux,
NewWallpaperWhoDis, NextExplorer, Portracker, Radicale, Speedtest
Tracker, Stirling PDF, Sure, Technitium, Tracktor, Uptime Kuma,
Vaultwarden, XWiki.
Remove it from 5 services whose image has no time zone data and logs in
UTC regardless: Beszel Hub, Homebox, Navidrome, Portainer, RustDesk
Server.
TZ stays in every .env file.
crypt0rr
approved these changes
Oct 2, 2026
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #356. This PR is stacked on that branch, so merge #356 first.
What changed
Every
.envdefinesTZ. This PR makescompose.yamlmatch what each image does with it.TZstays in every.envfile.Added
TZ=${TZ}to the app container (28 services). These definedTZin.envbut never passed it on, and their image uses it:Arcane, Booklore, Coder, ConvertX, copyparty, Dockge, Dockhand, Docmost, Dozzle, EspoCRM, FossFLOW, Glance, Gotify, Homepage, Memos, Miniflux, NewWallpaperWhoDis, NextExplorer, Portracker, Radicale, Speedtest Tracker, Stirling PDF, Sure (web and worker), Technitium, Tracktor, Uptime Kuma, Vaultwarden, XWiki.
Removed
TZ=${TZ}from the app container (5 services). These images have no time zone data and log in UTC whatever the value:Beszel Hub, Homebox, Navidrome, Portainer, RustDesk Server (
hbbsandhbbr).Behavior change
In the 28 services above, the app container now runs in the time zone from
.env, which defaults toEurope/Amsterdam. Until now those containers ran in UTC. Log timestamps and anything the app schedules by local time shift accordingly. SetTZin.envto your own zone, or toEtc/UTCto keep the old behavior.How each image was checked
All 150 images used in the repo were pulled and started with
TZ=Asia/Tokyo:date +%Z_%zinside the image. 115 images reportedJST_+0900.new Date().getTimezoneOffset()for Node.js images, the bundled JVM for Java images, and a search of the Go binary for embedded zone data.Left unchanged on purpose
TZ, andcompose.yamldid not pass it.TZ.TZ, but Ghost forces UTC internally and has its own site time zone setting, so it is not passed.TIME_ZONEvariable.TZbut receives it throughenv_file, so there is no line to remove.Testing
docker compose config --quietpasses in all 33 changed service directories.docker compose configresolvesTZtoEurope/Amsterdamon each of the 29 containers that gained it, and no longer sets it on the 6 containers that lost it.git diff --checkpasses.Not tested: the stacks were not started through a Tailnet. The images were only run on their own to check the time zone.