# Stage 1: Build frontend from Git-tracked sources FROM node:20-alpine AS frontend-builder WORKDIR /app/frontend # Copy frontend package files and source from the versioned src tree. COPY src/frontend/package.json src/frontend/pnpm-lock.yaml* ./ RUN npm install COPY src/frontend/ ./ RUN npm run build # Stage 2: Production runtime FROM node:20-alpine WORKDIR /app # Docker controls are required by the dashboard runtime. RUN apk add --no-cache docker-cli docker-cli-compose git curl unzip bash openssh-client RUN git config --global user.email "admin@santinova-soft.org" && \ git config --global user.name "Manus Dashboard" # Copy backend dependencies and source from the versioned src tree. COPY src/backend/package.json src/backend/package-lock.json ./backend/ WORKDIR /app/backend RUN npm ci --omit=dev COPY src/backend/ ./ # Copy the frontend built from the same Git revision. WORKDIR /app COPY --from=frontend-builder /app/frontend/dist ./frontend/dist WORKDIR /app/backend EXPOSE 3001 CMD ["node", "src/index.js"]