accent-detection / Dockerfile
ash-171's picture
Update Dockerfile
6ad39a0 verified
raw
history blame
1.09 kB
FROM python:3.10-slim
WORKDIR /app
# Install system packages
RUN apt-get update && apt-get install -y ffmpeg git wget && rm -rf /var/lib/apt/lists/*
# Defined permission for pretrained_models
ENV PYTHONUNBUFFERED=1
RUN mkdir -p /app/pretrained_models && chmod -R 777 /app/pretrained_models
ENV HOME=/app
# Set cache envs (for Whisper + Hugging Face + SpeechBrain)
ENV XDG_CACHE_HOME=/app/.cache
ENV SPEECHBRAIN_CACHE=/app/.cache/speechbrain
# Create cache dirs with write permission
RUN mkdir -p /app/.cache/whisper /app/.cache/speechbrain && chmod -R 777 /app/.cache
# Upgrade pip
RUN pip install --no-cache-dir --upgrade pip
# Copy source
COPY . .
# Download Hugging Face interface file
RUN mkdir -p src && wget -O src/custome_interface.py https://huggingface.co/Jzuluaga/accent-id-commonaccent_xlsr-en-english/resolve/main/custom_interface.py
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Expose Streamlit port
EXPOSE 8501
# Run Streamlit app
CMD ["streamlit", "run", "streamlit_app.py", "--server.port=8501", "--server.enableCORS=false"]