ayf3 commited on
Commit
c5f1d8d
·
verified ·
1 Parent(s): 38948ae

Upload Dockerfile with huggingface_hub

Browse files
Files changed (1) hide show
  1. Dockerfile +30 -8
Dockerfile CHANGED
@@ -1,17 +1,39 @@
1
- FROM python:3.11-slim
2
 
3
- RUN apt-get update && apt-get install -y --no-install-recommends \
4
- ffmpeg libsndfile1 build-essential && \
5
- rm -rf /var/lib/apt/lists/*
 
 
 
 
6
 
 
7
  RUN useradd -m -u 1000 user
8
- WORKDIR /app
9
 
10
- COPY requirements.txt .
11
- RUN pip install --no-cache-dir -r requirements.txt
 
 
 
 
 
 
12
 
13
- COPY . .
 
 
 
 
 
 
14
 
15
  USER user
 
 
 
 
 
16
  EXPOSE 7860
 
17
  CMD ["python", "app.py"]
 
1
+ FROM python:3.10-slim
2
 
3
+ WORKDIR /app
4
+
5
+ # System deps for audio processing
6
+ RUN apt-get update && apt-get install -y \
7
+ ffmpeg \
8
+ libsndfile1 \
9
+ && rm -rf /var/lib/apt/lists/*
10
 
11
+ # Create user (HF requires user ID 1000)
12
  RUN useradd -m -u 1000 user
 
13
 
14
+ # Install torch CPU-only first (much smaller than CUDA version)
15
+ RUN pip install --no-cache-dir --upgrade pip && \
16
+ pip install --no-cache-dir torch>=2.5.0 torchaudio>=2.5.0 \
17
+ --index-url https://download.pytorch.org/whl/cpu
18
+
19
+ # Install other deps
20
+ COPY requirements_docker.txt /tmp/requirements.txt
21
+ RUN pip install --no-cache-dir -r /tmp/requirements.txt
22
 
23
+ # Copy app
24
+ COPY app.py .
25
+ COPY reference_one.wav /data/reference_one.wav
26
+
27
+ # Permissions
28
+ RUN mkdir -p /data/output && \
29
+ chown -R user:user /data /app
30
 
31
  USER user
32
+
33
+ ENV PYTHONUNBUFFERED=1 \
34
+ PYTHONIOENCODING=UTF-8 \
35
+ HOME=/home/user
36
+
37
  EXPOSE 7860
38
+
39
  CMD ["python", "app.py"]