fix: set TZ=Europe/Bucharest in Docker + scheduler diagnostic logs

The container was running on UTC by default — the 1-5 AM window was
actually 4-8 AM Romania time, missing the intended night window.

- Add TZ=Europe/Bucharest + tzdata package to Dockerfile
- Add startup diagnostic logs: server time, timezone, ETERRA creds check

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
AI Assistant
2026-03-27 06:35:23 +02:00
parent 798b3e4f6b
commit c4516c6f23
2 changed files with 9 additions and 1 deletions
+2 -1
View File
@@ -37,9 +37,10 @@ FROM node:22-alpine AS runner
WORKDIR /app
ENV NODE_ENV=production
ENV TZ=Europe/Bucharest
# Install system deps + create user in a single layer
RUN apk add --no-cache gdal gdal-tools ghostscript qpdf \
RUN apk add --no-cache gdal gdal-tools ghostscript qpdf tzdata \
&& addgroup --system --gid 1001 nodejs \
&& adduser --system --uid 1001 nextjs
@@ -247,13 +247,20 @@ if (!g.__autoRefreshTimer) {
}
}, 60_000);
const now = new Date();
console.log(
`[auto-refresh] Scheduler pornit — verificare la fiecare ${CHECK_INTERVAL_MS / 60_000} min`,
);
console.log(
`[auto-refresh] Server time: ${now.toLocaleString("ro-RO")} (TZ=${process.env.TZ ?? "system"}, offset=${now.getTimezoneOffset()}min)`,
);
console.log(
`[auto-refresh] Weekday: ${NIGHT_START_HOUR}:00${NIGHT_END_HOUR}:00 refresh incremental`,
);
console.log(
`[auto-refresh] Weekend: Vin/Sam/Dum 23:0004:00 deep sync municipii`,
);
console.log(
`[auto-refresh] ETERRA creds: ${process.env.ETERRA_USERNAME ? "OK" : "MISSING"}`,
);
}