Upload Dockerfile
Browse files- Dockerfile +6 -3
Dockerfile
CHANGED
|
@@ -1,11 +1,14 @@
|
|
| 1 |
FROM python:3.11-slim
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
-
# Install
|
| 5 |
-
RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
|
| 6 |
|
| 7 |
COPY requirements.txt .
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
| 9 |
COPY . .
|
| 10 |
|
| 11 |
# Hugging Face exposes port 7860
|
|
|
|
| 1 |
FROM python:3.11-slim
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
+
# Install build tools for llama-cpp-python (C++ compiler)
|
| 5 |
+
RUN apt-get update && apt-get install -y g++ build-essential cmake curl && rm -rf /var/lib/apt/lists/*
|
| 6 |
|
| 7 |
COPY requirements.txt .
|
| 8 |
+
# Force single-threaded compilation to prevent OOMKilled on Hugging Face Spaces
|
| 9 |
+
ENV CMAKE_BUILD_PARALLEL_LEVEL=1
|
| 10 |
+
ENV MAKEFLAGS="-j1"
|
| 11 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 12 |
COPY . .
|
| 13 |
|
| 14 |
# Hugging Face exposes port 7860
|