build problem leider noch da, steigen aber bald auf docker repo um um custom image zu haben hier im git

This commit is contained in:
2025-12-05 01:37:19 +01:00
parent 45462aa74b
commit 68f83b7774
3 changed files with 23 additions and 10 deletions

View File

@@ -6,11 +6,11 @@ Wenn auf dem Production-Server der Fehler `Module not found: Can't resolve 'reac
## Lösung
Nach `git pull` auf dem Server müssen die Docker-Container neu gebaut werden:
Das Problem ist, dass das Volume `/app/node_modules` die installierten Dependencies überschreibt. Nach `git pull` auf dem Server müssen die Volumes gelöscht und die Container neu gebaut werden:
```bash
# Container stoppen
docker compose down
# Container stoppen und ALLE Volumes löschen (wichtig!)
docker compose down -v
# Container neu bauen (ohne Cache, um sicherzustellen, dass alle Dependencies neu installiert werden)
docker compose build --no-cache
@@ -22,14 +22,20 @@ docker compose up -d
docker compose logs -f
```
## Alternative: Volume löschen
**WICHTIG:** Das `-v` Flag ist entscheidend, da sonst das `node_modules` Volume die neu installierten Dependencies überschreibt!
Falls das Problem weiterhin besteht, kann das `node_modules` Volume gelöscht werden:
## Verifizierung
Nach dem Build sollte `react-icons` in `node_modules` vorhanden sein:
```bash
docker compose down -v
docker compose build --no-cache
docker compose up -d
docker compose exec web ls -la node_modules | grep react-icons
```
Falls das Problem weiterhin besteht, prüfen Sie, ob `package.json` wirklich `react-icons` enthält:
```bash
docker compose exec web cat package.json | grep react-icons
```
## Wichtige Dateien für den Build

View File

@@ -5,8 +5,8 @@ WORKDIR /app
# Copy package files first for better caching
COPY package.json package-lock.json* ./
# Install dependencies (no cache to ensure fresh install)
RUN npm install --no-cache
# Install dependencies
RUN npm install
# Copy app files
COPY . .

View File

@@ -1,4 +1,5 @@
import type { Metadata } from 'next'
import Script from 'next/script'
import './globals.css'
export const metadata: Metadata = {
@@ -20,6 +21,12 @@ export default function RootLayout({
</head>
<body>
{children}
{/* Rybbit Analytics */}
<Script
src="https://rybbit.doing-it.de/api/script.js"
data-site-id="733537db4b78"
strategy="afterInteractive"
/>
{/* Live Chat Integration - Platzhalter für Tawk.to, Crisp oder Intercom */}
{/*
<script dangerouslySetInnerHTML={{