Download Dockerfile from Vishinka/Code_LLM: direct link, hf CLI and curl.
- Browser
- Download file 1.38 kB
-
https://huggingface.co/spaces/Vishinka/Code_LLM/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/Vishinka/Code_LLM/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/Vishinka/Code_LLM/resolve/main/Dockerfile
1.38 kB
| FROM python:3.12-slim | |
| # Отключаем интерактивные диалоги при установке | |
| ENV DEBIAN_FRONTEND=noninteractive \ | |
| HF_HOME=/home/user/cache \ | |
| PYTHONUNBUFFERED=1 \ | |
| CMAKE_BUILD_PARALLEL_LEVEL=1 \ | |
| LLAMA_CPP_PYTHON_CUDA_SUPPORT=0 | |
| # Устанавливаем минимальные системные зависимости для компиляции | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| build-essential \ | |
| cmake \ | |
| libgomp1 \ | |
| ca-certificates \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Копируем requirements и устанавливаем зависимости ДО переключения пользователя | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir --upgrade pip setuptools wheel && \ | |
| pip install --no-cache-dir -r requirements.txt | |
| # Очищаем кэш apt и другие временные файлы | |
| RUN apt-get remove -y build-essential cmake && \ | |
| apt-get autoremove -y && \ | |
| apt-get clean | |
| # Создаем непривилегированного пользователя для HF Spaces | |
| RUN useradd -m -u 1000 user | |
| # Переключаемся на пользователя и копируем приложение | |
| USER user | |
| WORKDIR /app | |
| COPY --chown=user . . | |
| EXPOSE 7860 | |
| CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] | |