Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +8 -9
Dockerfile
CHANGED
|
@@ -5,21 +5,20 @@ FROM python:3.10-slim
|
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
# 1. Install System Dependencies
|
| 8 |
-
# '
|
| 9 |
-
# 'git' and 'curl' are retained for asset downloads and diffusers compatibility.
|
| 10 |
RUN apt-get update && apt-get install -y \
|
| 11 |
git \
|
| 12 |
curl \
|
| 13 |
build-essential \
|
|
|
|
| 14 |
&& rm -rf /var/lib/apt/lists/*
|
| 15 |
|
| 16 |
# 2. Download Retro Font (VT323)
|
| 17 |
-
# Keeps the aesthetic consistent with your "NeuralOS" theme.
|
| 18 |
RUN curl -L -o /app/VT323.ttf https://github.com/google/fonts/raw/main/ofl/vt323/VT323-Regular.ttf
|
| 19 |
|
| 20 |
# 3. Install Python Dependencies
|
| 21 |
-
#
|
| 22 |
-
#
|
| 23 |
RUN pip install --no-cache-dir \
|
| 24 |
torch \
|
| 25 |
torchvision \
|
|
@@ -30,20 +29,20 @@ RUN pip install --no-cache-dir \
|
|
| 30 |
transformers \
|
| 31 |
accelerate \
|
| 32 |
peft \
|
| 33 |
-
llama-cpp-python \
|
| 34 |
pillow \
|
| 35 |
diskcache \
|
| 36 |
safetensors \
|
| 37 |
-
scipy
|
|
|
|
|
|
|
| 38 |
|
| 39 |
-
# 4. Create a non-root user
|
| 40 |
RUN useradd -m -u 1000 user
|
| 41 |
USER user
|
| 42 |
ENV HOME=/home/user \
|
| 43 |
PATH=/home/user/.local/bin:$PATH
|
| 44 |
|
| 45 |
# 5. Write the Monolith Application to disk
|
| 46 |
-
# This merges drivers.py, index.html, and server.py into one file.
|
| 47 |
COPY --chown=user <<'EOF' app.py
|
| 48 |
import sys, os, io, base64, json, pickle, time
|
| 49 |
import numpy as np
|
|
|
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
# 1. Install System Dependencies
|
| 8 |
+
# ADDED: 'cmake' is strictly required for llama-cpp-python if building from source.
|
|
|
|
| 9 |
RUN apt-get update && apt-get install -y \
|
| 10 |
git \
|
| 11 |
curl \
|
| 12 |
build-essential \
|
| 13 |
+
cmake \
|
| 14 |
&& rm -rf /var/lib/apt/lists/*
|
| 15 |
|
| 16 |
# 2. Download Retro Font (VT323)
|
|
|
|
| 17 |
RUN curl -L -o /app/VT323.ttf https://github.com/google/fonts/raw/main/ofl/vt323/VT323-Regular.ttf
|
| 18 |
|
| 19 |
# 3. Install Python Dependencies
|
| 20 |
+
# CHANGED: Split llama-cpp-python to use pre-built wheels.
|
| 21 |
+
# This avoids the "Building wheel..." hang by downloading a compiled binary instead.
|
| 22 |
RUN pip install --no-cache-dir \
|
| 23 |
torch \
|
| 24 |
torchvision \
|
|
|
|
| 29 |
transformers \
|
| 30 |
accelerate \
|
| 31 |
peft \
|
|
|
|
| 32 |
pillow \
|
| 33 |
diskcache \
|
| 34 |
safetensors \
|
| 35 |
+
scipy \
|
| 36 |
+
&& pip install --no-cache-dir llama-cpp-python \
|
| 37 |
+
--extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
|
| 38 |
|
| 39 |
+
# 4. Create a non-root user
|
| 40 |
RUN useradd -m -u 1000 user
|
| 41 |
USER user
|
| 42 |
ENV HOME=/home/user \
|
| 43 |
PATH=/home/user/.local/bin:$PATH
|
| 44 |
|
| 45 |
# 5. Write the Monolith Application to disk
|
|
|
|
| 46 |
COPY --chown=user <<'EOF' app.py
|
| 47 |
import sys, os, io, base64, json, pickle, time
|
| 48 |
import numpy as np
|