OrbitMC commited on
Commit
38de7ab
·
verified ·
1 Parent(s): 786a1f7

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -12
Dockerfile CHANGED
@@ -1,28 +1,30 @@
1
  FROM python:3.11-slim
2
 
3
- # We removed ALL system installations (cmake, build-essential, git, ffmpeg, etc.)
4
- # to make the build nearly instant and avoid installing useless stuff.
 
 
5
 
6
- # HF Spaces requires uid 1000
7
  RUN useradd -m -u 1000 user
8
  USER user
9
  ENV PATH="/home/user/.local/bin:$PATH"
10
- ENV HF_HOME="/home/user/.cache/huggingface"
11
 
12
  WORKDIR /home/user/app
13
 
14
- # We use a PRE-BUILT wheel for llama-cpp-python so it installs in seconds (no C++ compiling!)
 
15
  RUN pip install --no-cache-dir --upgrade pip && \
16
  pip install --no-cache-dir \
17
- llama-cpp-python \
18
- --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu \
19
- edge-tts \
20
- flask==3.1.1 \
21
  "numpy<2.0" \
22
- num2words==0.5.14 \
23
- "huggingface_hub>=0.27.0"
 
24
 
25
- # Copy the rest of the application
26
  COPY --chown=user:user . .
27
 
28
  EXPOSE 7860
 
1
  FROM python:3.11-slim
2
 
3
+ # Install minimal system tools
4
+ RUN apt-get update && apt-get install -y --no-install-recommends \
5
+ ffmpeg \
6
+ && rm -rf /var/lib/apt/lists/*
7
 
8
+ # Set up user
9
  RUN useradd -m -u 1000 user
10
  USER user
11
  ENV PATH="/home/user/.local/bin:$PATH"
 
12
 
13
  WORKDIR /home/user/app
14
 
15
+ # IMPORTANT: --only-binary :all: tells pip to NEVER compile C++ code
16
+ # It forces it to use pre-built wheels, which takes seconds.
17
  RUN pip install --no-cache-dir --upgrade pip && \
18
  pip install --no-cache-dir \
19
+ "flask" \
20
+ "edge-tts" \
21
+ "num2words" \
22
+ "huggingface_hub" \
23
  "numpy<2.0" \
24
+ "llama-cpp-python" \
25
+ --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu \
26
+ --only-binary :all:
27
 
 
28
  COPY --chown=user:user . .
29
 
30
  EXPOSE 7860