NitinBot001 commited on
Commit
13533e9
·
verified ·
1 Parent(s): 7be18fb

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -19
Dockerfile CHANGED
@@ -1,35 +1,28 @@
1
- # Use a Python base image
2
  FROM python:3.10-slim
3
 
4
- # Install necessary system packages
5
  RUN apt-get update && apt-get install -y \
6
  git ffmpeg curl build-essential \
7
- && apt-get clean \
8
- && rm -rf /var/lib/apt/lists/*
9
 
10
- # Set working directory
11
  WORKDIR /app
12
 
13
- # Create fallback cache directories
14
- RUN mkdir -p /app/whisper_cache \
15
- && mkdir -p /tmp/.whisper_cache \
16
- && mkdir -p /app/whisper_models
17
 
18
- # Set environment variables
19
- ENV XDG_CACHE_HOME=/app/whisper_cache
20
- ENV WHISPER_CACHE=/app/whisper_cache
 
 
21
 
22
- # Copy your Python requirements
23
  COPY requirements.txt .
24
-
25
- # Install Python dependencies
26
  RUN pip install --no-cache-dir -r requirements.txt
27
 
28
- # Copy your app files
29
  COPY . .
30
 
31
- # Expose port if you're running a web app (like with Flask)
32
  EXPOSE 7860
33
 
34
- # Set the entrypoint command
35
- CMD ["python", "main.py"]
 
 
1
  FROM python:3.10-slim
2
 
 
3
  RUN apt-get update && apt-get install -y \
4
  git ffmpeg curl build-essential \
5
+ && apt-get clean && rm -rf /var/lib/apt/lists/*
 
6
 
 
7
  WORKDIR /app
8
 
9
+ # Create writable cache directories
10
+ RUN mkdir -p /app/hf_cache/hub \
11
+ && mkdir -p /app/hf_cache/xet \
12
+ && mkdir -p /app/hf_cache/assets
13
 
14
+ # Set environment variables BEFORE installing libs
15
+ ENV HF_HOME=/app/hf_cache
16
+ ENV HF_HUB_CACHE=/app/hf_cache/hub
17
+ ENV HF_XET_CACHE=/app/hf_cache/xet
18
+ ENV HF_ASSETS_CACHE=/app/hf_cache/assets
19
 
 
20
  COPY requirements.txt .
 
 
21
  RUN pip install --no-cache-dir -r requirements.txt
22
 
 
23
  COPY . .
24
 
25
+ # Expose port for web apps (Flask/Gradio/etc.)
26
  EXPOSE 7860
27
 
28
+ CMD ["python", "main.py"]