From 229cbf7223550df5e07cafe759a93d724b5ef5c1 Mon Sep 17 00:00:00 2001 From: rxf Date: Thu, 19 Mar 2026 11:29:36 +0100 Subject: [PATCH] nochmal --- Dockerfile | 2 ++ components/AppLayout.tsx | 9 ++++++++- docker-compose.yml | 2 ++ package.json | 2 +- 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index cd30151..17673fc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,6 +16,8 @@ COPY . . # Standalone-Output aktiviert kleinste Images ENV NEXT_TELEMETRY_DISABLED=1 +ARG BUILD_DATE +ENV NEXT_PUBLIC_BUILD_DATE=$BUILD_DATE RUN npm run build # ── Stage 3: Produktions-Image ──────────────────────────────────────────────── diff --git a/components/AppLayout.tsx b/components/AppLayout.tsx index 032cfd9..8d74a16 100644 --- a/components/AppLayout.tsx +++ b/components/AppLayout.tsx @@ -1,5 +1,6 @@ 'use client'; +import { useEffect, useState } from 'react'; import LogoutButton from '@/components/LogoutButton'; import packageJson from '@/package.json'; @@ -9,7 +10,13 @@ interface AppLayoutProps { export default function AppLayout({ children }: AppLayoutProps) { const version = packageJson.version; - const buildDate = process.env.NEXT_PUBLIC_BUILD_DATE || new Date().toLocaleDateString('de-DE', { day: '2-digit', month: '2-digit', year: 'numeric' }); + const [buildDate, setBuildDate] = useState(process.env.NEXT_PUBLIC_BUILD_DATE || ''); + + useEffect(() => { + if (!buildDate) { + setBuildDate(new Date().toLocaleDateString('de-DE', { day: '2-digit', month: '2-digit', year: 'numeric' })); + } + }, []); return (
diff --git a/docker-compose.yml b/docker-compose.yml index a911056..c84b09c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -15,6 +15,8 @@ services: build: context: . dockerfile: Dockerfile + args: + BUILD_DATE: "$(date +%d.%m.%Y)" platforms: - linux/amd64 - linux/arm64 diff --git a/package.json b/package.json index ab3689c..5fae618 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tabletten_next", - "version": "1.2.0", + "version": "1.2.1", "private": true, "scripts": { "dev": "next dev",