accent-detection / Dockerfile
ash-171's picture
Update Dockerfile
b157c0a verified
raw
history blame
1.31 kB
FROM python:3.10-slim
# Set working directory
WORKDIR /app
# Install system packages
RUN apt-get update && apt-get install -y ffmpeg git wget && rm -rf /var/lib/apt/lists/*
# Set environment for proper model caching and permissions
ENV PYTHONUNBUFFERED=1
ENV HOME=/app
ENV XDG_CACHE_HOME=/app/.cache
ENV SPEECHBRAIN_CACHE=/app/.cache/speechbrain
# Create all needed directories with write permissions
RUN mkdir -p /app/pretrained_models \
/app/wav2vec2_checkpoints \
/app/pretrained_asr \
/app/.cache/whisper \
/app/.cache/speechbrain \
/app/tmp \
&& chmod -R 777 /app/pretrained_models \
/app/wav2vec2_checkpoints \
/app/pretrained_asr \
/app/.cache \
/app/tmp
# Upgrade pip
RUN pip install --no-cache-dir --upgrade pip --root-user-action=ignore
# 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 --root-user-action=ignore
# Expose Streamlit port
EXPOSE 8501
# Run Streamlit app
CMD ["streamlit", "run", "streamlit_app.py", "--server.port=8501"]