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
FROM node:20 AS builder
FROM node:20-bookworm AS builder
WORKDIR /app
# 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 ONLY package.json
COPY package.json ./
# Install dependencies from scratch for the container's architecture
RUN npm install
# Install dependencies
# --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 . .
@@ -18,7 +19,7 @@ COPY . .
RUN npm run build
# Stage 2: Setup the Production Server
FROM node:20
FROM node:20-bookworm-slim
WORKDIR /app
@@ -26,7 +27,7 @@ WORKDIR /app
COPY package.json ./
# 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 --from=builder /app/dist ./dist

View File

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