Fixed tensorflow-macos that fails on linux
This commit is contained in:
15
Dockerfile
15
Dockerfile
@@ -19,11 +19,14 @@ FROM python:3.11-slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install runtime dependencies only
|
||||
# Install runtime dependencies (libgomp for OpenMP parallelism)
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
libgomp1 \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# FAISS uses OpenMP for parallel search - set threads for Xeon
|
||||
ENV OMP_NUM_THREADS=8
|
||||
|
||||
# Copy installed packages from builder
|
||||
COPY --from=builder /root/.local /root/.local
|
||||
ENV PATH=/root/.local/bin:$PATH
|
||||
@@ -34,10 +37,12 @@ COPY config.py .
|
||||
COPY reverse_icon_search.py .
|
||||
COPY run_api_server.py .
|
||||
|
||||
# Copy pre-built index and filenames (must be provided at build time or mounted)
|
||||
# These files are large and should be mounted as volumes in production
|
||||
# COPY index.faiss .
|
||||
# COPY filenames.pkl .
|
||||
# Copy pre-built index and filenames for inference
|
||||
# Option 1: Bundle in image (~530 MB)
|
||||
COPY index.faiss .
|
||||
COPY filenames.pkl .
|
||||
|
||||
# Option 2: Mount as volume at runtime (uncomment above, use docker run -v)
|
||||
|
||||
# Create necessary directories
|
||||
RUN mkdir -p uploads logs
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
# Core ML/DL
|
||||
tensorflow-macos
|
||||
tensorflow-metal
|
||||
tensorflow-macos; platform_system == "Darwin" and platform_machine == "arm64"
|
||||
tensorflow-metal; platform_system == "Darwin" and platform_machine == "arm64"
|
||||
tensorflow~=2.14.0; platform_system != "Darwin"
|
||||
keras~=2.14.0
|
||||
numpy~=1.26.2
|
||||
scikit-learn~=1.3.2
|
||||
|
||||
Reference in New Issue
Block a user