Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +19 -13
Dockerfile
CHANGED
@@ -1,30 +1,36 @@
|
|
1 |
FROM python:3.9-slim
|
2 |
|
3 |
-
# Install system dependencies
|
4 |
-
RUN apt-get update && apt-get install -y
|
|
|
|
|
|
|
5 |
|
6 |
-
#
|
7 |
ENV HF_HOME=/app/cache \
|
8 |
XDG_CACHE_HOME=/app/cache \
|
9 |
-
|
10 |
-
PYTHONUSERBASE=/app/python-deps \
|
11 |
-
PATH="/app/python-deps/bin:$PATH"
|
12 |
|
13 |
-
# Create
|
14 |
-
RUN mkdir -p /app/cache
|
15 |
chmod -R 777 /app
|
16 |
|
17 |
-
# Set working directory
|
18 |
WORKDIR /app
|
19 |
|
20 |
-
#
|
21 |
COPY requirements.txt .
|
22 |
|
23 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
RUN pip install --no-cache-dir -r requirements.txt
|
25 |
|
26 |
-
# Copy application code
|
27 |
COPY . .
|
28 |
|
29 |
-
# Run FastAPI
|
30 |
CMD uvicorn app:app --host 0.0.0.0 --port 7860
|
|
|
1 |
FROM python:3.9-slim
|
2 |
|
3 |
+
# 1. Install system dependencies
|
4 |
+
RUN apt-get update && apt-get install -y \
|
5 |
+
espeak-ng \
|
6 |
+
libsndfile1 \
|
7 |
+
git # Needed for installing from git
|
8 |
|
9 |
+
# 2. Configure environment
|
10 |
ENV HF_HOME=/app/cache \
|
11 |
XDG_CACHE_HOME=/app/cache \
|
12 |
+
PYTHONPATH="${PYTHONPATH}:/app"
|
|
|
|
|
13 |
|
14 |
+
# 3. Create directories with proper permissions
|
15 |
+
RUN mkdir -p /app/cache && \
|
16 |
chmod -R 777 /app
|
17 |
|
|
|
18 |
WORKDIR /app
|
19 |
|
20 |
+
# 4. Install Python dependencies
|
21 |
COPY requirements.txt .
|
22 |
|
23 |
+
# First install setup tools
|
24 |
+
RUN pip install --upgrade pip setuptools wheel
|
25 |
+
|
26 |
+
# Install misaki with proper data files
|
27 |
+
RUN pip install "misaki[ja,zh] @ git+https://github.com/uezo/misaki.git"
|
28 |
+
|
29 |
+
# Then install other requirements
|
30 |
RUN pip install --no-cache-dir -r requirements.txt
|
31 |
|
32 |
+
# 5. Copy application code
|
33 |
COPY . .
|
34 |
|
35 |
+
# 6. Run FastAPI
|
36 |
CMD uvicorn app:app --host 0.0.0.0 --port 7860
|