Merge pull request #32 from outis1one/claude/fix-rembg-docker-build-CWGXj
Fix onnxruntime executable stack error in Docker build
This commit is contained in:
@@ -22,6 +22,7 @@ FROM python:3.11-slim
|
|||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Install system dependencies for OpenCV, rembg, SAM, and image processing
|
# Install system dependencies for OpenCV, rembg, SAM, and image processing
|
||||||
|
# execstack is needed to fix onnxruntime executable stack issue in containers
|
||||||
RUN apt-get update && apt-get install -y \
|
RUN apt-get update && apt-get install -y \
|
||||||
libgl1 \
|
libgl1 \
|
||||||
libglib2.0-0 \
|
libglib2.0-0 \
|
||||||
@@ -31,12 +32,17 @@ RUN apt-get update && apt-get install -y \
|
|||||||
libgomp1 \
|
libgomp1 \
|
||||||
wget \
|
wget \
|
||||||
git \
|
git \
|
||||||
|
execstack \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Copy requirements and install Python dependencies
|
# Copy requirements and install Python dependencies
|
||||||
COPY backend/requirements.txt .
|
COPY backend/requirements.txt .
|
||||||
RUN pip install --no-cache-dir -r requirements.txt
|
RUN pip install --no-cache-dir -r requirements.txt
|
||||||
|
|
||||||
|
# Fix onnxruntime executable stack issue in containers
|
||||||
|
# This clears the executable stack requirement from the onnxruntime library
|
||||||
|
RUN execstack -c /usr/local/lib/python3.11/site-packages/onnxruntime/capi/onnxruntime_pybind11_state.cpython-311-x86_64-linux-gnu.so || true
|
||||||
|
|
||||||
# Pre-download rembg model (u2net) to avoid first-run delay
|
# Pre-download rembg model (u2net) to avoid first-run delay
|
||||||
# Note: This downloads the U2-Net model (~170MB) during build
|
# Note: This downloads the U2-Net model (~170MB) during build
|
||||||
RUN python -c "from rembg import remove; print('rembg model downloaded')"
|
RUN python -c "from rembg import remove; print('rembg model downloaded')"
|
||||||
|
|||||||
Reference in New Issue
Block a user