AIencoder commited on
Commit
733fb2c
·
verified ·
1 Parent(s): 672f157

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -43
Dockerfile CHANGED
@@ -1,61 +1,29 @@
1
- # Force rebuild 1
2
- # Use Python 3.11 for compatibility (Matches your wheels)
3
  FROM python:3.11-slim
4
 
5
- # Set working directory
6
  WORKDIR /app
7
 
8
  # Install system dependencies
9
  RUN apt-get update && apt-get install -y \
10
- build-essential \
11
- libopenblas-dev \
12
- libomp-dev \
13
  && rm -rf /var/lib/apt/lists/*
14
 
15
- # --- FIX STARTS HERE ---
16
- # Create cache directories on /data and matplotlib config dir
17
- RUN mkdir -p \
18
- /data/.huggingface \
19
- /data/.cache/huggingface/datasets \
20
- /data/.cache/huggingface/transformers \
21
- /tmp/matplotlib \
22
- && chmod -R 777 /data /tmp/matplotlib
23
-
24
- # Clean any old Hugging Face caches (defensive)
25
- RUN rm -rf \
26
- /root/.cache/huggingface \
27
- /root/.cache/huggingface_hub \
28
- /root/.cache/huggingface/datasets || true
29
-
30
- # Set cache environment variables to point at /data
31
  ENV HF_HOME=/data/.huggingface
32
- ENV HF_HUB_CACHE=/data/.cache/huggingface/hub
33
- ENV HF_DATASETS_CACHE=/data/.cache/huggingface/datasets
34
- ENV TRANSFORMERS_CACHE=/data/.cache/huggingface/transformers
35
- ENV MPLCONFIGDIR=/tmp/matplotlib
36
- # --- FIX ENDS HERE ---
37
-
38
- # Copy requirements file
39
- COPY requirements.txt /app/requirements.txt
40
 
41
- # Install dependencies
42
- RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt
 
 
 
 
43
 
44
- # Install PyTorch separately for compatibility
45
- RUN pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
46
-
47
- # 1. Copy entrypoint to the ROOT directory (Critical Fix)
48
  COPY entrypoint.sh /entrypoint.sh
49
  RUN chmod +x /entrypoint.sh
50
 
51
- # 2. Copy the rest of the app to /app
52
- COPY . /app
53
-
54
- # Expose port
55
  EXPOSE 7860
56
 
57
- # --- CRITICAL FIX: Run the entrypoint script first ---
58
  ENTRYPOINT ["/entrypoint.sh"]
59
-
60
- # Run the application
61
  CMD ["python", "app.py"]
 
 
 
1
  FROM python:3.11-slim
2
 
 
3
  WORKDIR /app
4
 
5
  # Install system dependencies
6
  RUN apt-get update && apt-get install -y \
7
+ ffmpeg \
 
 
8
  && rm -rf /var/lib/apt/lists/*
9
 
10
+ # Set cache to persistent storage
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  ENV HF_HOME=/data/.huggingface
12
+ ENV HF_HUB_CACHE=/data/.huggingface/hub
 
 
 
 
 
 
 
13
 
14
+ # Install your wheel + dependencies
15
+ RUN pip install --no-cache-dir \
16
+ https://github.com/Ary5272/llama-cpp-python/releases/download/v0.1.1/llama_cpp_python-0.3.16-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl \
17
+ gradio \
18
+ faster-whisper \
19
+ huggingface_hub
20
 
21
+ # Copy app
22
+ COPY app.py /app/app.py
 
 
23
  COPY entrypoint.sh /entrypoint.sh
24
  RUN chmod +x /entrypoint.sh
25
 
 
 
 
 
26
  EXPOSE 7860
27
 
 
28
  ENTRYPOINT ["/entrypoint.sh"]
 
 
29
  CMD ["python", "app.py"]