From 862d90c2b7f9ce38f4a4afe945c3737ecbca532b Mon Sep 17 00:00:00 2001 From: David Montero Crespo Date: Fri, 6 Mar 2026 13:17:14 -0300 Subject: [PATCH] fix: streamline Docker build process and update build scripts --- Dockerfile.standalone | 9 +++------ frontend/package.json | 1 + 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Dockerfile.standalone b/Dockerfile.standalone index 058f55f..6138f78 100644 --- a/Dockerfile.standalone +++ b/Dockerfile.standalone @@ -3,10 +3,6 @@ FROM node:20 AS frontend-builder WORKDIR /app -# Copy root package.json (metadata/scripts) -COPY package.json . -RUN npm install - # Build avr8js COPY wokwi-libs/avr8js/ wokwi-libs/avr8js/ WORKDIR /app/wokwi-libs/avr8js @@ -23,11 +19,12 @@ WORKDIR /app/wokwi-libs/wokwi-elements RUN npm install && npm run build --if-present # Build frontend +# components-metadata.json is already committed; skip generate:metadata +# (it requires wokwi-elements/src which isn't needed at runtime) WORKDIR /app COPY frontend/ frontend/ -COPY scripts/ scripts/ WORKDIR /app/frontend -RUN npm install && npm run build +RUN npm install && npm run build:docker # ---- Stage 2: Final Production Image ---- diff --git a/frontend/package.json b/frontend/package.json index 3302104..0c9f0f6 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -7,6 +7,7 @@ "generate:metadata": "cd .. && npx tsx scripts/generate-component-metadata.ts", "dev": "npm run generate:metadata && vite", "build": "npm run generate:metadata && tsc -b && vite build", + "build:docker": "tsc -b && vite build", "lint": "eslint .", "preview": "vite preview", "test": "vitest run",