OrbitMC commited on
Commit
180bb8d
·
verified ·
1 Parent(s): 5191be0

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +20 -6
Dockerfile CHANGED
@@ -1,15 +1,29 @@
1
- FROM python:3.12-slim
2
 
3
- WORKDIR /app
 
 
 
 
 
4
 
5
- RUN apt-get update && apt-get install -y --no-install-recommends libsndfile1 && rm -rf /var/lib/apt/lists/*
 
 
 
6
 
7
- RUN pip install --no-cache-dir flask huggingface-hub soundfile ctransformers
8
 
9
- RUN pip install --no-cache-dir https://github.com/KittenML/KittenTTS/releases/download/0.8.1/kittentts-0.8.1-py3-none-any.whl
 
 
 
10
 
11
- COPY app.py .
 
12
 
 
13
  EXPOSE 7860
14
 
 
15
  CMD ["python", "app.py"]
 
1
+ FROM python:3.11-slim
2
 
3
+ # System dependencies for soundfile & audio
4
+ RUN apt-get update && apt-get install -y --no-install-recommends \
5
+ libsndfile1 \
6
+ ffmpeg \
7
+ build-essential \
8
+ && rm -rf /var/lib/apt/lists/*
9
 
10
+ # Create non-root user (HF Spaces requires uid 1000)
11
+ RUN useradd -m -u 1000 user
12
+ USER user
13
+ ENV PATH="/home/user/.local/bin:$PATH"
14
 
15
+ WORKDIR /home/user/app
16
 
17
+ # Install Python dependencies
18
+ COPY --chown=user:user requirements.txt .
19
+ RUN pip install --no-cache-dir --upgrade pip && \
20
+ pip install --no-cache-dir -r requirements.txt
21
 
22
+ # Copy application code
23
+ COPY --chown=user:user . .
24
 
25
+ # Expose port 7860 (HF Spaces default)
26
  EXPOSE 7860
27
 
28
+ # Start the app
29
  CMD ["python", "app.py"]