Features: - Vue 3 frontend with Three.js/Online3DViewer - Node.js API with PostgreSQL and Redis - Python worker for model conversion - Docker Compose for deployment - ViewCube navigation with drag rotation and 90° snap - Cross-section, exploded view, and render settings - Parts tree with visibility controls 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
55 lines
1.4 KiB
Docker
55 lines
1.4 KiB
Docker
# Python Worker for 3D Model Conversion
|
|
FROM python:3.12-slim
|
|
|
|
WORKDIR /app
|
|
|
|
# Install system dependencies for 3D processing and headless rendering
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
# OpenGL/OSMesa for headless rendering (pyrender)
|
|
libosmesa6-dev \
|
|
libgl1 \
|
|
libglu1-mesa \
|
|
# Build tools for some Python packages
|
|
build-essential \
|
|
# OpenCASCADE runtime libraries for cascadio (STEP conversion)
|
|
libocct-data-exchange-7.8 \
|
|
libocct-draw-7.8 \
|
|
libocct-foundation-7.8 \
|
|
libocct-modeling-algorithms-7.8 \
|
|
libocct-modeling-data-7.8 \
|
|
libocct-ocaf-7.8 \
|
|
libocct-visualization-7.8 \
|
|
# Cleanup
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Set environment for headless rendering
|
|
ENV PYOPENGL_PLATFORM=osmesa
|
|
|
|
# Install uv for fast package management
|
|
RUN pip install --no-cache-dir uv
|
|
|
|
# Copy project files
|
|
COPY pyproject.toml .
|
|
COPY src/ src/
|
|
|
|
# Create __init__.py files if they don't exist
|
|
RUN touch src/__init__.py src/processors/__init__.py src/services/__init__.py
|
|
|
|
# Install dependencies using uv
|
|
RUN uv pip install --system -e .
|
|
|
|
# Create non-root user
|
|
RUN groupadd --system --gid 1001 worker && \
|
|
useradd --system --uid 1001 --gid worker worker && \
|
|
mkdir -p /tmp/conversions && \
|
|
chown -R worker:worker /app /tmp/conversions
|
|
|
|
# Switch to non-root user
|
|
USER worker
|
|
|
|
# Set temp directory
|
|
ENV TEMP_DIR=/tmp/conversions
|
|
|
|
# Run the worker
|
|
CMD ["python", "-m", "src.main"]
|