# Stage 1: Build Frontend FROM node:18-alpine AS frontend-build WORKDIR /app/frontend COPY frontend/package*.json ./ RUN npm install COPY frontend/ ./ RUN npm run build # Stage 2: Build Backend & Serve FROM node:18-alpine WORKDIR /app/backend # Install python and build dependencies RUN apk add --no-cache python3 py3-pip python3-dev build-base && \ python3 -m venv /opt/venv ENV PATH="/opt/venv/bin:$PATH" # Install backend dependencies COPY backend/package*.json ./ RUN npm install --production # Copy backend source COPY backend/ ./ # Install python dependencies RUN pip install --no-cache-dir -r python_service/requirements.txt # Copy built frontend to the public directory expected by server.js # (__dirname is /app/backend/src, so ../../public is /app/public) COPY --from=frontend-build /app/frontend/dist /app/public # Set production environment ENV NODE_ENV=production ENV PORT=3010 EXPOSE 3010 CMD ["node", "src/server.js"] # Cache bust 20260625222919 # Cache bust 20260625223615