OrbitMC commited on
Commit
769e541
·
verified ·
1 Parent(s): 38de7ab

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -11
Dockerfile CHANGED
@@ -1,30 +1,32 @@
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
 
1
  FROM python:3.11-slim
2
 
3
+ # Install minimal system tools needed for audio (ffmpeg)
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 for Hugging Face Spaces
9
  RUN useradd -m -u 1000 user
10
  USER user
11
  ENV PATH="/home/user/.local/bin:$PATH"
12
+ ENV HF_HOME="/home/user/.cache/huggingface"
13
 
14
  WORKDIR /home/user/app
15
 
16
+ # Install dependencies.
17
+ # We keep the extra-index-url so it downloads the fast CPU wheel,
18
+ # but removed --only-binary so it correctly detects our Debian (glibc) environment.
19
  RUN pip install --no-cache-dir --upgrade pip && \
20
  pip install --no-cache-dir \
21
+ flask==3.1.1 \
22
+ edge-tts \
23
+ num2words==0.5.14 \
24
+ "huggingface_hub>=0.27.0" \
25
  "numpy<2.0" \
26
+ llama-cpp-python \
27
+ --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
 
28
 
29
+ # Copy the rest of the application
30
  COPY --chown=user:user . .
31
 
32
  EXPOSE 7860