Skip to content

All services: pass TZ to a container only when its image uses it - #357

Merged
jackspiering merged 3 commits into
mainfrom
tz-wire-compose
Oct 2, 2026
Merged

jackspiering merged 3 commits into
mainfrom
tz-wire-compose

Conversation

@jackspiering

@jackspiering jackspiering commented Oct 2, 2026 •

Copy link
Copy Markdown
Collaborator

Follow-up to #356. This PR is stacked on that branch, so merge #356 first.

What changed

Every .env defines TZ. This PR makes compose.yaml match what each image does with it. TZ stays in every .env file.

Added TZ=${TZ} to the app container (28 services). These defined TZ in .env but 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 (hbbs and hbbr).

Behavior change

In the 28 services above, the app container now runs in the time zone from .env, which defaults to Europe/Amsterdam. Until now those containers ran in UTC. Log timestamps and anything the app schedules by local time shift accordingly. Set TZ in .env to your own zone, or to Etc/UTC to keep the old behavior.

How each image was checked

All 150 images used in the repo were pulled and started with TZ=Asia/Tokyo:

  1. date +%Z_%z inside the image. 115 images reported JST_+0900.
  2. For the rest, the runtime was checked, because it can carry its own time zone data: new Date().getTimezoneOffset() for Node.js images, the bundled JVM for Java images, and a search of the Go binary for embedded zone data.
  3. Seven images that failed both (Beszel Hub, Beszel Agent, Homebox, Meilisearch, Navidrome, Portainer, RustDesk Server) were started with their normal entrypoint and their log timestamps were compared with UTC. All seven logged UTC. Ollama and the Tailscale image were judged on steps 1 and 2 only.

Left unchanged on purpose

  • Beszel Agent, Ollama: the image does not use TZ, and compose.yaml did not pass it.
  • Tailscale exit node, subnet router, app connector: the Tailscale image does not use TZ.
  • Ghost: Node.js reads TZ, but Ghost forces UTC internally and has its own site time zone setting, so it is not passed.
  • Seafile: uses its own TIME_ZONE variable.
  • Karakeep: Meilisearch ignores TZ but receives it through env_file, so there is no line to remove.
  • Database and cache containers: only app containers were changed.

Testing

  • docker compose config --quiet passes in all 33 changed service directories.
  • docker compose config resolves TZ to Europe/Amsterdam on each of the 29 containers that gained it, and no longer sets it on the 6 containers that lost it.
  • git diff --check passes.

Not tested: the stacks were not started through a Tailnet. The images were only run on their own to check the time zone.

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.
@jackspiering
jackspiering requested a review from crypt0rr October 2, 2026 21:08
Base automatically changed from tz-env-consistency to main October 2, 2026 21:09
@jackspiering
jackspiering merged commit 614c3de into main Oct 2, 2026
1 check passed
@jackspiering
jackspiering deleted the tz-wire-compose branch October 2, 2026 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants