correzioni build

This commit is contained in:
fcarraUniSa
2025-12-10 12:40:10 +01:00
parent 83ed4cb518
commit 345cec7af3
2 changed files with 22 additions and 21 deletions

View File

@@ -1,15 +1,16 @@
# Stage 1: Build the React Application # Stage 1: Build the React Application
FROM node:20 AS builder FROM node:20-bookworm AS builder
WORKDIR /app WORKDIR /app
# Copy ONLY package.json. # Copy ONLY package.json
# We intentionally IGNORE package-lock.json to prevent architecture mismatches
# (e.g., trying to install macOS binaries for esbuild on Linux).
COPY package.json ./ COPY package.json ./
# Install dependencies from scratch for the container's architecture # Install dependencies
RUN npm install # --legacy-peer-deps: Ignores peer dependency conflicts
# --no-audit: Skips vulnerability audit (faster, less noise)
# --no-fund: Hides funding messages
RUN npm install --legacy-peer-deps --no-audit --no-fund
# Copy the rest of the application source code # Copy the rest of the application source code
COPY . . COPY . .
@@ -18,7 +19,7 @@ COPY . .
RUN npm run build RUN npm run build
# Stage 2: Setup the Production Server # Stage 2: Setup the Production Server
FROM node:20 FROM node:20-bookworm-slim
WORKDIR /app WORKDIR /app
@@ -26,7 +27,7 @@ WORKDIR /app
COPY package.json ./ COPY package.json ./
# Install ONLY production dependencies # Install ONLY production dependencies
RUN npm install --omit=dev RUN npm install --omit=dev --legacy-peer-deps --no-audit --no-fund
# Copy the built frontend assets from the 'builder' stage # Copy the built frontend assets from the 'builder' stage
COPY --from=builder /app/dist ./dist COPY --from=builder /app/dist ./dist

View File

@@ -5,13 +5,13 @@
"type": "module", "type": "module",
"dependencies": { "dependencies": {
"@google/genai": "^0.1.0", "@google/genai": "^0.1.0",
"lucide-react": "^0.294.0", "lucide-react": "^0.344.0",
"react": "^18.2.0", "react": "^18.2.0",
"react-dom": "^18.2.0", "react-dom": "^18.2.0",
"express": "^4.18.2", "express": "^4.19.2",
"mysql2": "^3.9.1", "mysql2": "^3.9.7",
"pg": "^8.11.3", "pg": "^8.11.5",
"dotenv": "^16.4.1", "dotenv": "^16.4.5",
"cors": "^2.8.5" "cors": "^2.8.5"
}, },
"scripts": { "scripts": {
@@ -20,13 +20,13 @@
"build": "vite build" "build": "vite build"
}, },
"devDependencies": { "devDependencies": {
"@types/react": "^18.2.43", "@types/react": "^18.2.79",
"@types/react-dom": "^18.2.17", "@types/react-dom": "^18.2.25",
"@vitejs/plugin-react": "^4.2.1", "@vitejs/plugin-react": "^4.2.1",
"autoprefixer": "^10.4.16", "autoprefixer": "^10.4.19",
"postcss": "^8.4.32", "postcss": "^8.4.38",
"tailwindcss": "^3.4.0", "tailwindcss": "^3.4.3",
"typescript": "^5.3.3", "typescript": "^5.4.5",
"vite": "^5.0.10" "vite": "^5.2.11"
} }
} }