Switched von pnpm to npm, adapt Dockerfiles

This commit is contained in:
2025-09-12 16:16:16 +00:00
parent f3b72da9fe
commit 1d23b7591d
2 changed files with 9 additions and 10 deletions

View File

@@ -9,11 +9,11 @@ FROM node:20-alpine AS build
WORKDIR /app
# Kopiere package.json und pnpm-lock.yaml
COPY package.json pnpm-lock.yaml ./
COPY package.json package-lock.json ./
# Installiere pnpm und dann die Abhängigkeiten
# --prod stellt sicher, dass nur Produktions-Abhängigkeiten installiert werden
RUN npm install -g pnpm && pnpm install --frozen-lockfile
RUN npm install --frozen-lockfile
# Kopiere den restlichen Quellcode
COPY . .
@@ -23,7 +23,7 @@ ARG VITE_API_URL
ENV VITE_API_URL=${VITE_API_URL}
# Baue die Anwendung für die Produktion
RUN pnpm build
RUN npm run build
# Stage 2: Produktions-Umgebung
FROM nginx:1.25-alpine

View File

@@ -1,6 +1,6 @@
# ==========================================
# dashboard/Dockerfile.dev (Development)
# 🔧 OPTIMIERT: Für schnelle Entwicklung mit Vite und pnpm
# 🔧 OPTIMIERT: Für schnelle Entwicklung mit Vite und npm
# ==========================================
FROM node:20-alpine
@@ -11,19 +11,18 @@ WORKDIR /workspace
# 🔧 HINZUGEFÜGT: Installiere curl, damit das wait-for-backend.sh Skript funktioniert
RUN apk add --no-cache curl
# Installiere pnpm, da es im Projekt verwendet wird.
RUN npm install -g pnpm
RUN npm install -g npm
# Kopiere die package-Dateien in das korrekte Unterverzeichnis.
# Dies nutzt den Docker-Cache: Wenn sich die Dateien nicht ändern,
# wird der `pnpm install`-Schritt übersprungen.
COPY package.json pnpm-lock.yaml* ./
# wird der `npm install`-Schritt übersprungen.
COPY package.json package-lock.json* ./
# Wechsle in das Dashboard-Verzeichnis, um die Befehle auszuführen.
WORKDIR /workspace/dashboard
# Installiere ALLE Abhängigkeiten (inkl. devDependencies)
RUN pnpm install
RUN npm install
# Das Kopieren des restlichen Codes ist nicht nötig, da das gesamte
# Verzeichnis `./:/workspace` in der docker-compose.override.yml gemountet wird.
@@ -33,4 +32,4 @@ EXPOSE 5173 9229
# Der Startbefehl wird in der docker-compose.override.yml definiert.
# Ein Standard-CMD ist dennoch eine gute Praxis.
CMD ["pnpm", "run", "dev", "--", "--host", "0.0.0.0", "--port", "5173"]
CMD ["npm", "run", "dev", "--", "--host", "0.0.0.0", "--port", "5173"]