Files
HartOMat/.env.example
T
Hartmut 9d1a820295 refactor(A2): replace blender-renderer HTTP service with render-worker Celery container
- Create render-worker/ with Dockerfile (Ubuntu + cadquery + Blender via host mount)
- Add render-worker/check_version.py: verifies Blender >= 5.0.1 at startup, Exit 1 on failure
- Add render-worker/scripts/: blender_render.py, still_render.py, turntable_render.py
- Create backend/app/services/render_blender.py: direct subprocess rendering
  - convert_step_to_stl() and export_per_part_stls() using cadquery
  - render_still(): STEP → STL → PNG via Blender subprocess
  - is_blender_available(): detects BLENDER_BIN env for render-worker context
- Create backend/app/domains/rendering/tasks.py: render_still_task + render_turntable_task
- Update step_processor.py: use subprocess path when BLENDER_BIN env is set (render-worker)
- Update step_tasks.py: generate_stl_cache uses direct cadquery instead of HTTP
- Remove blender-renderer and threejs-renderer from docker-compose.yml
- Replace worker-thumbnail with render-worker (Ubuntu + cadquery + Blender mount)
- Remove Docker SDK from backend Dockerfile (was only for flamenco scaling)
- Update .env.example: BLENDER_VERSION=5.0.1 documented
- Update celery_app.py: include domains.rendering.tasks in autodiscover

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-06 15:48:46 +01:00

36 lines
1015 B
Bash

# Database
POSTGRES_DB=schaeffler
POSTGRES_USER=schaeffler
POSTGRES_PASSWORD=schaeffler
POSTGRES_HOST=postgres
POSTGRES_PORT=5432
# Redis
REDIS_URL=redis://redis:6379/0
# JWT
JWT_SECRET_KEY=your-secret-key-here-change-in-production
JWT_ALGORITHM=HS256
JWT_ACCESS_TOKEN_EXPIRE_MINUTES=480
# Azure OpenAI
AZURE_OPENAI_API_KEY=your-azure-openai-key
AZURE_OPENAI_ENDPOINT=https://your-resource.openai.azure.com/
AZURE_OPENAI_DEPLOYMENT=gpt-4o
AZURE_OPENAI_API_VERSION=2024-02-01
# File Storage
UPLOAD_DIR=/app/uploads
MAX_UPLOAD_SIZE_MB=500
# Celery worker concurrency (default: 8 parallel CAD jobs per worker container)
# Scale horizontally with: docker compose up --scale worker=N
CELERY_WORKER_CONCURRENCY=8
# Blender (render-worker)
# Blender >= 5.0.1 must be installed on the host at /opt/blender
# The render-worker container mounts it read-only via volumes: - /opt/blender:/opt/blender:ro
BLENDER_VERSION=5.0.1
# Set to host path if Blender is not at /opt/blender:
# BLENDER_BIN=/usr/local/blender/blender