Spaces:
Sleeping
Sleeping
levanel commited on
Commit ·
3cb9d60
1
Parent(s): 402851b
Fix Dockerfile stages and dependencies
Browse files11234564 unmodified lines111213121415161718194 unmodified lines24252623272829303132333429353637384 unmodified lines43444540464748495051# Stage 1: Build your module# ==========================================# STAGE 1: Build Environment (Temporary)# ==========================================FROM python:3.10-slim AS builder
RUN apt-get update && apt-get install -y --no-install-recommends \4 unmodified lines && rm -rf /var/lib/apt/lists/*
WORKDIR /appRUN pip install --no-cache-dir gradio numpy pypdf transformers torch --extra-index-url https://download.pytorch.org/whl/cpu
# The builder ONLY needs pybind11 to compile the C++ code!RUN pip install --no-cache-dir pybind11
# Copy only what your engine needsCOPY CMakeLists.txt ./4 unmodified lines cmake -DCMAKE_BUILD_TYPE=Release .. && \ make vecmini
# Stage 2: Final Runtime Environment# ==========================================# STAGE 2: Final Runtime Environment (Your App)# ==========================================FROM python:3.10-slim
RUN useradd -m -u 1000 userWORKDIR /home/user/app
# Install runtime math dependencies# Install runtime C++ math dependenciesRUN apt-get update && apt-get install -y --no-install-recommends \ libopenblas0 \ libomp-dev \4 unmodified lines
# Copy your frontend code (app.py)COPY --chown=user . /home/user/appRUN pip install --no-cache-dir gradio numpy
# IMPORTANT: This is where ALL the runtime Python packages go!RUN pip install --no-cache-dir gradio numpy pypdf transformers torch --extra-index-url https://download.pytorch.org/whl/cpu
ENV PORT=7860EXPOSE 7860Dockerfile+13-5