bfd58e3419
Bug A: Media Library thumbnails were gray because <img src> cannot send JWT auth headers. Added useAuthBlob() hook (fetch + createObjectURL) in MediaBrowser.tsx. Also fixed publish_asset Celery task to populate product_id + cad_file_id on MediaAsset for thumbnail fallback resolution. Bug B: Product dimensions now shown in Product Details card with Ruler icon and "from CAD" label when cad_mesh_attributes.dimensions_mm exists. Bug C: Replaced 128×128 CAD thumbnail with InlineCadViewer component. Queries gltf_geometry MediaAssets, fetches GLB via auth fetch → blob URL → Three.js Canvas with OrbitControls. Falls back to thumbnail + "Load 3D Model" button. Polling when GLB generation is in progress. Bug D: trimesh was in [cad] optional extra but Dockerfile only installed [dev]. Changed to pip install -e ".[dev,cad]" — trimesh now available in backend container, GLB + Colors export works. Also added bbox extraction (STL-first numpy parsing) in render_step_thumbnail and admin "Re-extract CAD Metadata" bulk endpoint. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
36 lines
798 B
Docker
36 lines
798 B
Docker
# Stage 0: grab docker CLI + compose plugin
|
|
FROM docker:cli AS docker-cli
|
|
|
|
FROM python:3.11-slim
|
|
|
|
WORKDIR /app
|
|
|
|
# System dependencies
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
libpq-dev \
|
|
gcc \
|
|
libpango-1.0-0 \
|
|
libpangoft2-1.0-0 \
|
|
libcairo2 \
|
|
libgdk-pixbuf-2.0-0 \
|
|
libffi-dev \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Copy docker CLI for worker scaling
|
|
COPY --from=docker-cli /usr/local/bin/docker /usr/local/bin/docker
|
|
|
|
# Install Python dependencies (dev + cad extras: pytest, trimesh, pygltflib)
|
|
COPY pyproject.toml .
|
|
RUN pip install --no-cache-dir -e ".[dev,cad]"
|
|
|
|
# Copy app code
|
|
COPY . .
|
|
|
|
# Create upload dirs
|
|
RUN mkdir -p uploads/step_files uploads/excel_files uploads/thumbnails
|
|
|
|
COPY start.sh /start.sh
|
|
RUN chmod +x /start.sh
|
|
|
|
EXPOSE 8000
|