Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +4 -20
Dockerfile
CHANGED
|
@@ -31,17 +31,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
| 31 |
&& rm -rf /var/lib/apt/lists/* \
|
| 32 |
&& apt-get clean
|
| 33 |
|
| 34 |
-
# Download and install Piper TTS with shared libraries
|
| 35 |
-
RUN wget https://github.com/rhasspy/piper/releases/download/v1.2.0/piper_amd64.tar.gz -O /tmp/piper.tar.gz && \
|
| 36 |
-
mkdir -p /opt/piper && \
|
| 37 |
-
tar -xzf /tmp/piper.tar.gz -C /opt/piper --strip-components=1 && \
|
| 38 |
-
chmod -R 755 /opt/piper && \
|
| 39 |
-
chmod +x /opt/piper/piper && \
|
| 40 |
-
rm -rf /tmp/piper.tar.gz
|
| 41 |
-
|
| 42 |
-
# Set library path for Piper
|
| 43 |
-
ENV LD_LIBRARY_PATH=/opt/piper:$LD_LIBRARY_PATH
|
| 44 |
-
|
| 45 |
# Stage 2: Python dependencies
|
| 46 |
FROM base as python-deps
|
| 47 |
|
|
@@ -51,8 +40,6 @@ WORKDIR /app
|
|
| 51 |
COPY requirements.txt .
|
| 52 |
|
| 53 |
# Upgrade pip and install Python dependencies
|
| 54 |
-
# Note: transformers >= 4.30 compatibility is handled via monkey patch in app/utils/transformers_patch.py
|
| 55 |
-
# Note: Piper TTS binary is installed separately above, not via pip
|
| 56 |
RUN pip install --upgrade pip setuptools wheel && \
|
| 57 |
pip install --no-cache-dir -r requirements.txt
|
| 58 |
|
|
@@ -78,10 +65,8 @@ ENV DOWNLOAD_MODELS=1 \
|
|
| 78 |
SPACY_HOME=/tmp \
|
| 79 |
XDG_CACHE_HOME=/tmp
|
| 80 |
|
| 81 |
-
# Create argos packages directory
|
| 82 |
-
RUN mkdir -p /app/.argos_packages
|
| 83 |
-
mkdir -p /tmp/.local/share/piper/voices && \
|
| 84 |
-
chmod -R 777 /tmp/.local
|
| 85 |
|
| 86 |
# Download models - show errors but continue if they fail
|
| 87 |
RUN echo "Starting model download..." && \
|
|
@@ -91,7 +76,6 @@ RUN echo "Starting model download..." && \
|
|
| 91 |
ls -la models/stt/ || true && \
|
| 92 |
ls -la models/translate/ || true && \
|
| 93 |
ls -la models/tts/ || true && \
|
| 94 |
-
ls -la /tmp/.local/share/piper/voices/ || true && \
|
| 95 |
echo "Checking Argos packages:" && \
|
| 96 |
ls -la /app/.argos_packages/ || true || \
|
| 97 |
echo "Warning: Some models failed to download. They will be downloaded on first use."
|
|
@@ -154,9 +138,9 @@ ENV HOST=0.0.0.0 \
|
|
| 154 |
FONTCONFIG_PATH=/tmp/fontconfig \
|
| 155 |
ARGOS_PACKAGES_DIR=/app/.argos_packages
|
| 156 |
|
| 157 |
-
# Create cache directories with proper permissions (including SpaCy's cache needs
|
| 158 |
USER root
|
| 159 |
-
RUN mkdir -p /tmp/numba_cache /tmp/matplotlib /tmp/fontconfig /tmp/.cache /tmp/spacy
|
| 160 |
chmod -R 777 /tmp && \
|
| 161 |
chown -R appuser:appuser /app/.argos_packages
|
| 162 |
USER appuser
|
|
|
|
| 31 |
&& rm -rf /var/lib/apt/lists/* \
|
| 32 |
&& apt-get clean
|
| 33 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
# Stage 2: Python dependencies
|
| 35 |
FROM base as python-deps
|
| 36 |
|
|
|
|
| 40 |
COPY requirements.txt .
|
| 41 |
|
| 42 |
# Upgrade pip and install Python dependencies
|
|
|
|
|
|
|
| 43 |
RUN pip install --upgrade pip setuptools wheel && \
|
| 44 |
pip install --no-cache-dir -r requirements.txt
|
| 45 |
|
|
|
|
| 65 |
SPACY_HOME=/tmp \
|
| 66 |
XDG_CACHE_HOME=/tmp
|
| 67 |
|
| 68 |
+
# Create argos packages directory
|
| 69 |
+
RUN mkdir -p /app/.argos_packages
|
|
|
|
|
|
|
| 70 |
|
| 71 |
# Download models - show errors but continue if they fail
|
| 72 |
RUN echo "Starting model download..." && \
|
|
|
|
| 76 |
ls -la models/stt/ || true && \
|
| 77 |
ls -la models/translate/ || true && \
|
| 78 |
ls -la models/tts/ || true && \
|
|
|
|
| 79 |
echo "Checking Argos packages:" && \
|
| 80 |
ls -la /app/.argos_packages/ || true || \
|
| 81 |
echo "Warning: Some models failed to download. They will be downloaded on first use."
|
|
|
|
| 138 |
FONTCONFIG_PATH=/tmp/fontconfig \
|
| 139 |
ARGOS_PACKAGES_DIR=/app/.argos_packages
|
| 140 |
|
| 141 |
+
# Create cache directories with proper permissions (including SpaCy's cache needs)
|
| 142 |
USER root
|
| 143 |
+
RUN mkdir -p /tmp/numba_cache /tmp/matplotlib /tmp/fontconfig /tmp/.cache /tmp/spacy && \
|
| 144 |
chmod -R 777 /tmp && \
|
| 145 |
chown -R appuser:appuser /app/.argos_packages
|
| 146 |
USER appuser
|