Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files12345678910111213141516171819202122232425262728FROM python:3.10-slim# Install system toolsRUN apt-get update && apt-get install -y curl git && rm -rf /var/lib/apt/lists/*# Set up user and home directoryRUN useradd -m -u 1000 userENV HOME=/home/user \PATH=/home/user/.local/bin:$PATH# Create the app directory and set permissions BEFORE switching usersWORKDIR $HOME/appRUN chown user:user $HOME/appUSER user# Install the pre-compiled wheelRUN pip install --no-cache-dir \https://github.com/mrzeeshanahmed/llama-cpp-python/releases/download/v0.3.17-manylinux-x86_64/llama_cpp_python-0.3.17-cp310-cp310-manylinux_2_17_x86_64.whl \huggingface-hub \hf-transfer \ipython# Copy files and ensure they belong to 'user'COPY --chown=user . .# Use python to run the script directly first to check for errorsCMD ["python", "app.py"]123456789101112131415161718192021222324252627282930FROM python:3.10-slim# Install system dependenciesRUN apt-get update && apt-get install -y curl git && rm -rf /var/lib/apt/lists/*# Set up user and environmentRUN useradd -m -u 1000 userENV HOME=/home/user \PATH=/home/user/.local/bin:$PATHWORKDIR $HOME/app# Pre-create cache directory with correct permissionsRUN mkdir -p $HOME/app/model_cache && chown -R user:user $HOME/appUSER user# Install libraries (using the pre-compiled wheel for llama-cpp)RUN pip install --no-cache-dir \https://github.com/mrzeeshanahmed/llama-cpp-python/releases/download/v0.3.17-manylinux-x86_64/llama_cpp_python-0.3.17-cp310-cp310-manylinux_2_17_x86_64.whl \huggingface-hub \hf-transfer \ipython \numpy# Copy application filesCOPY --chown=user . .# Run the scriptCMD ["python", "app.py"]
Dockerfile+10-8