Spaces:
Build error

Language_Translation / Dockerfile
Gajanand1's picture
Update Dockerfile
b39448a verified
Raw History Blame Contribute Delete
974 Bytes
# Use Python 3.10
FROM python:3.10-slim
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
gcc \
ffmpeg \
&& rm -rf /var/lib/apt/lists/*
# Upgrade pip and install numpy
RUN pip install --no-cache-dir --upgrade pip setuptools wheel && \
pip install --no-cache-dir numpy==1.23.5
# Copy requirements
COPY requirements.txt .
# Install Python packages
RUN pip install --no-cache-dir \
speechrecognition==3.10.0 \
gtts==2.4.0 \
pyttsx3==2.90 \
pydub==0.25.1 \
langdetect==1.0.9 \
requests==2.31.0 \
translators==5.5.2 \
streamlit==1.28.0 \
click==8.1.7 \
protobuf==3.20.3
# Copy application file
COPY app.py .
# Create temp directory
RUN mkdir -p /tmp/audio_cache
# Set environment variables
ENV PYTHONUNBUFFERED=1
ENV STREAMLIT_SERVER_PORT=7860
ENV STREAMLIT_SERVER_ADDRESS=0.0.0.0
EXPOSE 7860
CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]