jisaacso219 commited on
Commit
403a9a4
·
verified ·
1 Parent(s): 3389a92

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +18 -11
Dockerfile CHANGED
@@ -1,24 +1,31 @@
 
1
  FROM python:3.10-slim
2
 
3
- # Install system dependencies
4
- RUN apt-get update && apt-get install -y git ffmpeg libsndfile1 && apt-get clean
 
 
 
 
5
 
6
- # Set Hugging Face + Numba environment configs
7
- ENV TRANSFORMERS_CACHE=/tmp/hf_cache
8
- ENV HF_HOME=/tmp/hf_home
9
- ENV NUMBA_DISABLE_CACHE=1
10
  # Set working directory
11
  WORKDIR /app
12
 
13
- # Copy files
14
- COPY . /app
15
 
16
- # Install Python dependencies
17
  RUN pip install --upgrade pip
18
- RUN pip install -r requirements.txt
 
 
 
 
 
 
19
 
20
  # Expose port
21
  EXPOSE 7860
22
 
23
- # Run app
24
  CMD ["python", "app.py"]
 
1
+ # Base image
2
  FROM python:3.10-slim
3
 
4
+ # Install system packages
5
+ RUN apt-get update && apt-get install -y \
6
+ git \
7
+ ffmpeg \
8
+ libsndfile1 \
9
+ && apt-get clean
10
 
 
 
 
 
11
  # Set working directory
12
  WORKDIR /app
13
 
14
+ # Copy all project files
15
+ COPY . .
16
 
17
+ # Upgrade pip
18
  RUN pip install --upgrade pip
19
+
20
+ # Install dependencies with CPU-only PyTorch
21
+ RUN pip install --extra-index-url https://download.pytorch.org/whl/cpu -r requirements.txt
22
+
23
+ # Set cache dir for Hugging Face models to avoid /.cache permission errors
24
+ ENV TRANSFORMERS_CACHE=/app/cache/huggingface
25
+ ENV HF_HOME=/app/cache/huggingface
26
 
27
  # Expose port
28
  EXPOSE 7860
29
 
30
+ # Start the Flask app
31
  CMD ["python", "app.py"]