Files
admin bb827f197d Fix: Container-Zeitzone Europe/Berlin (Januar fehlte, Ladetage nicht markiert)
Ursache: Container lief in UTC, waehrend die Flux-Aggregation Europe/Berlin
nutzt. Dadurch lagen die in JS (Lokalzeit) berechneten Monats-/Tagesgrenzen
eine Stunde neben den Flux-Balken:
- Januar-Balken (Berlin = 31.12. 23:00 UTC) lag vor 'start' (UTC) und wurde
  weggefiltert.
- Ladetag-Zeitstempel (UTC-Mitternacht) passten nicht auf die Verbrauchsbalken
  (Berliner Mitternacht) -> keine Markierung.

Fix: tzdata ins Image + TZ=Europe/Berlin (Dockerfile und compose). Damit
stimmt die JS-Lokalzeit mit der Flux-Location ueberein. Verifiziert: im
Container ergibt new Date(2026,0,1) den Berliner Monatsanfang.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-28 17:13:06 +02:00

57 lines
1.3 KiB
Docker

# Multi-stage build for Next.js application (standalone output)
FROM node:22-alpine AS base
# Install dependencies only when needed
FROM base AS deps
RUN apk add --no-cache libc6-compat
WORKDIR /app
# Copy package files
COPY package.json package-lock.json* ./
RUN npm ci
# Rebuild the source code only when needed
FROM base AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
# Set build date as build argument
ARG BUILD_DATE
ENV NEXT_PUBLIC_BUILD_DATE=${BUILD_DATE}
# Disable telemetry during build
ENV NEXT_TELEMETRY_DISABLED=1
# Build the application
RUN npm run build
# Production image, copy all the files and run next
FROM base AS runner
WORKDIR /app
ENV NODE_ENV=production
ENV NEXT_TELEMETRY_DISABLED=1
# Zeitzone Europe/Berlin: JS-Lokalzeit muss mit der Flux-Aggregation (Berlin)
# uebereinstimmen, sonst werden Tages-/Monatsgrenzen falsch zugeordnet.
RUN apk add --no-cache tzdata
ENV TZ=Europe/Berlin
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
# Copy necessary files
COPY --from=builder /app/public ./public
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
USER nextjs
EXPOSE 3000
ENV PORT=3000
ENV HOSTNAME="0.0.0.0"
CMD ["node", "server.js"]