Fix rembg/onnxruntime Docker build issue
- Use onnxruntime 1.14.1 (older version without executable stack requirement) - Make rembg pre-download optional (won't fail build if onnxruntime has issues) - Remove Background will be disabled if rembg can't load
This commit is contained in:
+4
-3
@@ -37,9 +37,10 @@ RUN apt-get update && apt-get install -y \
|
||||
COPY backend/requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
# Pre-download rembg model (u2net) to avoid first-run delay
|
||||
# Note: This downloads the U2-Net model (~170MB) during build
|
||||
RUN python -c "from rembg import remove; print('rembg model downloaded')"
|
||||
# Try to pre-download rembg model, but don't fail build if onnxruntime has issues
|
||||
# (onnxruntime can have executable stack issues in some Docker environments)
|
||||
# If this fails, Remove Background feature will be disabled
|
||||
RUN python -c "from rembg import remove; print('rembg ready')" || echo "WARNING: rembg not available - Remove Background will be disabled"
|
||||
|
||||
# Copy backend application
|
||||
COPY backend/ .
|
||||
|
||||
Reference in New Issue
Block a user