Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +18 -24
Dockerfile
CHANGED
@@ -3,42 +3,36 @@ FROM python:3.9-slim
|
|
3 |
# 1. Install system dependencies
|
4 |
RUN apt-get update && apt-get install -y \
|
5 |
espeak-ng \
|
|
|
6 |
libsndfile1 \
|
7 |
-
|
8 |
|
9 |
# 2. Configure environment
|
10 |
-
ENV
|
11 |
-
|
12 |
-
PYTHONPATH="
|
13 |
-
|
14 |
-
# 3. Create
|
15 |
-
RUN mkdir -p /app/cache
|
16 |
-
|
17 |
-
mkdir -p /.local && \
|
18 |
-
chmod -R 777 /app && \
|
19 |
-
chmod -R 777 /.local && \
|
20 |
-
chmod -R 777 /usr/local/lib/python3.9/site-packages
|
21 |
|
22 |
WORKDIR /app
|
23 |
|
24 |
# 4. Install Python dependencies
|
25 |
COPY requirements.txt .
|
26 |
|
27 |
-
|
28 |
-
|
29 |
|
30 |
-
#
|
31 |
-
RUN pip install --no-cache-dir
|
32 |
|
33 |
-
#
|
34 |
-
RUN
|
35 |
-
|
36 |
-
# Pre-download the model with explicit permissions
|
37 |
-
RUN python -c "from huggingface_hub import hf_hub_download; hf_hub_download('hexgrad/Kokoro-82M', 'config.json')" || true && \
|
38 |
-
chmod -R 777 /app/cache
|
39 |
|
40 |
-
#
|
41 |
COPY . .
|
42 |
|
43 |
-
#
|
44 |
CMD uvicorn app:app --host 0.0.0.0 --port 7860
|
|
|
3 |
# 1. Install system dependencies
|
4 |
RUN apt-get update && apt-get install -y \
|
5 |
espeak-ng \
|
6 |
+
git \
|
7 |
libsndfile1 \
|
8 |
+
curl
|
9 |
|
10 |
# 2. Configure environment
|
11 |
+
ENV PYTHONUNBUFFERED=1 \
|
12 |
+
HF_HOME=/app/cache \
|
13 |
+
PYTHONPATH="/app"
|
14 |
+
|
15 |
+
# 3. Create cache directory with permissions
|
16 |
+
RUN mkdir -p /app/cache && \
|
17 |
+
chmod -R 777 /app/cache
|
|
|
|
|
|
|
|
|
18 |
|
19 |
WORKDIR /app
|
20 |
|
21 |
# 4. Install Python dependencies
|
22 |
COPY requirements.txt .
|
23 |
|
24 |
+
RUN pip install --upgrade pip setuptools wheel && \
|
25 |
+
pip install --no-cache-dir -r requirements.txt
|
26 |
|
27 |
+
# 5. Install misaki from source (with data files)
|
28 |
+
RUN pip install git+https://github.com/hexgrad/misaki.git --no-cache-dir
|
29 |
|
30 |
+
# 6. Fix PulseAudio warnings
|
31 |
+
RUN mkdir -p /.config/pulse && \
|
32 |
+
chmod -R 777 /.config
|
|
|
|
|
|
|
33 |
|
34 |
+
# 7. Copy application code
|
35 |
COPY . .
|
36 |
|
37 |
+
# 8. Run FastAPI
|
38 |
CMD uvicorn app:app --host 0.0.0.0 --port 7860
|