diff --git a/Dockerfile b/Dockerfile index dd3851c..3c47926 100644 --- a/Dockerfile +++ b/Dockerfile @@ -82,11 +82,22 @@ FROM debian:trixie-slim AS runtime # tzdata so the TZ env (set in compose) resolves — otherwise Go can't load the # zone and time.Now() stays UTC, and mavend answers clock/date queries and # evaluates quiet-hours in UTC. +# +# TZ is a build arg as well as an env because the image was self-inconsistent +# without it (V-545): compose set TZ=Europe/Samara and Go read it, but +# /etc/localtime still pointed at Etc/UTC, so anything asking the system zone +# instead of the environment answered UTC. The reminder path shells out to +# python dateparser, which is exactly such a caller. Compose passes the same +# zone it already declares, so the zone is written in one place. +ARG TZ=Etc/UTC +ENV TZ=$TZ RUN apt-get update && apt-get install -y --no-install-recommends \ ca-certificates libvulkan1 mesa-vulkan-drivers libgomp1 tzdata \ python3 python3-pip && \ pip3 install --no-cache-dir --break-system-packages 'dateparser==1.4.1' && \ apt-get purge -y --auto-remove python3-pip && \ + ln -snf "/usr/share/zoneinfo/$TZ" /etc/localtime && \ + echo "$TZ" > /etc/timezone && \ rm -rf /var/lib/apt/lists/* # runtime native libs: whisper/ggml (incl. vulkan) are real files in deps/lib. diff --git a/docker-compose.yml b/docker-compose.yml index ab84b8f..eb8a7aa 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,7 +12,12 @@ x-image: &image # build on EVERY service (same image name ⇒ built once) so `docker compose # build ` actually rebuilds. With build on only one service, the # others silently no-op and you deploy a stale binary. - build: . + build: + context: . + # the zone is declared once, here. The image points /etc/localtime at it so + # a caller reading the system zone agrees with one reading TZ (V-545). + args: + TZ: Europe/Samara pull_policy: never # only ever the locally-built image restart: unless-stopped # local time for clock/date replies AND quiet-hours evaluation. Change to