f5ca91ee02
- Layout: mobile hamburger menu + overlay backdrop + close button; content area always full-width - Media browser: filter chips (default still+turntable); advanced toggle for GLB/STL; thumbnail_url previews for non-image types; video hover-play for turntable - Backend: asset_types multi-filter, thumbnail_url in MediaAssetOut, download proxy endpoint for MinIO/local files - Admin: "Import Existing Media" button → POST /api/admin/import-media-assets - Billing: fix invoice create 500 (MissingGreenlet — use selectinload after commit); PDF download uses axios blob instead of bare <a href> (auth header missing); fix storage.upload() accepting str|Path - SSE task logs: task_logs.py core + router, LiveRenderLog component - CadPreview: fix infinite loop when no gltf_geometry assets; loading screen before ThreeDViewer render - render-worker: add trimesh layer to Dockerfile Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
79 lines
2.5 KiB
Docker
79 lines
2.5 KiB
Docker
FROM ubuntu:22.04
|
|
|
|
ARG BLENDER_VERSION=5.0.1
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
ENV PYTHONUNBUFFERED=1
|
|
ENV BLENDER_VERSION=${BLENDER_VERSION}
|
|
# Blender 5.x is mounted from the host at /opt/blender (see docker-compose.yml)
|
|
ENV BLENDER_BIN=/opt/blender/blender
|
|
# OSMesa for headless cadquery/VTK (no display needed)
|
|
ENV PYOPENGL_PLATFORM=osmesa
|
|
ENV VTK_DEFAULT_EGL=0
|
|
|
|
# Runtime libraries for cadquery/OCC + Blender 5.x headless
|
|
# Also installs Python 3.11 via deadsnakes PPA (Ubuntu 22.04 ships 3.10)
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
software-properties-common gnupg gpg-agent \
|
|
&& add-apt-repository ppa:deadsnakes/ppa -y \
|
|
&& apt-get update && apt-get install -y --no-install-recommends \
|
|
python3.11 \
|
|
python3.11-dev \
|
|
python3.11-distutils \
|
|
python3-pip \
|
|
python3-dev \
|
|
curl \
|
|
libpq-dev \
|
|
gcc \
|
|
libxrender1 \
|
|
libxi6 \
|
|
libxkbcommon-x11-0 \
|
|
libsm6 \
|
|
libglib2.0-0 \
|
|
libgl1-mesa-glx \
|
|
libosmesa6 \
|
|
libgomp1 \
|
|
libxfixes3 \
|
|
libxrandr2 \
|
|
libxcursor1 \
|
|
libxinerama1 \
|
|
libwayland-client0 \
|
|
libwayland-cursor0 \
|
|
libwayland-egl1 \
|
|
libvulkan1 \
|
|
mesa-vulkan-drivers \
|
|
libegl1 \
|
|
libegl-mesa0 \
|
|
libgbm1 \
|
|
ffmpeg \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /app
|
|
|
|
# Use Python 3.11 as the default pip target
|
|
RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python3.11 \
|
|
&& update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1 \
|
|
&& update-alternatives --install /usr/bin/pip3 pip3 /usr/local/bin/pip3.11 1
|
|
|
|
# Install backend Python dependencies (includes celery, sqlalchemy, fastapi, etc.)
|
|
COPY backend/pyproject.toml .
|
|
RUN pip3 install --no-cache-dir -e .
|
|
|
|
# Install cadquery (heavy — installed after backend deps for better layer caching)
|
|
RUN pip3 install --no-cache-dir "cadquery>=2.4.0"
|
|
|
|
# Install trimesh for STL→GLB geometry export (separate layer to avoid cache invalidation)
|
|
RUN pip3 install --no-cache-dir "trimesh>=4.2.0"
|
|
|
|
# Copy render scripts
|
|
COPY render-worker/scripts/ /render-scripts/
|
|
|
|
# Version check script — fails fast if Blender < 5.0.1
|
|
COPY render-worker/check_version.py /check_version.py
|
|
|
|
# Copy backend app code (overridden by volume mount in docker-compose)
|
|
COPY backend/ .
|
|
|
|
# Verify Blender version at build time if binary is available
|
|
# (skipped during build since /opt/blender is a host mount)
|
|
CMD ["bash", "-c", "python3 /check_version.py && celery -A app.tasks.celery_app worker --loglevel=info -Q thumbnail_rendering --concurrency=1"]
|