Spaces:
Build error
Build error
Update Dockerfile
Browse files12345678910111213141516171819202122232425262728293031323334353637383940414243441 unmodified line4647484950515253# Use Python 3.10 specificallyFROM python:3.10-slim# Set working directoryWORKDIR /app# Install system dependenciesRUN apt-get update && apt-get install -y \gcc \g++ \make \portaudio19-dev \python3-pyaudio \ffmpeg \libsndfile1 \&& rm -rf /var/lib/apt/lists/*# Upgrade pip and install setuptools firstRUN pip install --no-cache-dir --upgrade pip setuptools wheel# Copy requirements first (for better caching)COPY requirements.txt .# Install Python packages - one by one to isolate issuesRUN pip install --no-cache-dir numpy==1.23.5 && \pip install --no-cache-dir speechrecognition==3.10.0 && \pip install --no-cache-dir gtts==2.4.0 && \pip install --no-cache-dir pyttsx3==2.90 && \pip install --no-cache-dir pydub==0.25.1 && \pip install --no-cache-dir langdetect==1.0.9 && \pip install --no-cache-dir playsound==1.3.0 && \pip install --no-cache-dir requests==2.31.0 && \pip install --no-cache-dir translators==5.5.2 && \pip install --no-cache-dir streamlit==1.28.0# Copy application filesCOPY web_translator_final.py ./app.pyCOPY voice_translator_final.py ./COPY setup_voice_translator.py ./# Create necessary directoriesRUN mkdir -p /tmp/audio_cache# Set environment variables1 unmodified lineENV STREAMLIT_SERVER_PORT=7860ENV STREAMLIT_SERVER_ADDRESS=0.0.0.0# Expose portEXPOSE 7860# Run the applicationCMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]1234567891011121314151617181920212223242526272829303132333435363738394041421 unmodified line444546474849# Force Python 3.10FROM python:3.10-slimWORKDIR /app# Install system dependenciesRUN apt-get update && apt-get install -y \gcc \g++ \portaudio19-dev \python3-pyaudio \ffmpeg \&& rm -rf /var/lib/apt/lists/*# Upgrade pip and install numpy first (pre-built wheel)RUN pip install --no-cache-dir --upgrade pip setuptools wheel && \pip install --no-cache-dir numpy==1.23.5# Copy requirementsCOPY requirements.txt .# Install remaining packagesRUN pip install --no-cache-dir \speechrecognition==3.10.0 \gtts==2.4.0 \pyttsx3==2.90 \pydub==0.25.1 \langdetect==1.0.9 \playsound==1.3.0 \requests==2.31.0 \translators==5.5.2 \streamlit==1.28.0# Copy application filesCOPY web_translator_final.py ./app.pyCOPY voice_translator_final.py ./COPY setup_voice_translator.py ./# Create temp directoryRUN mkdir -p /tmp/audio_cache# Set environment variables1 unmodified lineENV STREAMLIT_SERVER_PORT=7860ENV STREAMLIT_SERVER_ADDRESS=0.0.0.0EXPOSE 7860CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]
Dockerfile+17-21