voice_detection / Dockerfile
ranar110
Fix: Add missing system dependencies (libsndfile1, ffmpeg) for audio processing
728c5f3
raw
history blame contribute delete
895 Bytes
FROM python:3.9
# Set up a new user named "user" with user ID 1000
RUN useradd -m -u 1000 user
# Switch to the "user" user
USER user
# Set home to the user's home directory
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
WORKDIR $HOME/app
# Force rebuild - updated static files (2026-02-02)
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
COPY --chown=user . $HOME/app
# Install system dependencies for audio processing (librosa, etc.)
USER root
RUN apt-get update && apt-get install -y \
libsndfile1 \
ffmpeg \
&& rm -rf /var/lib/apt/lists/*
# Switch back to the "user" user
USER user
# Install requirements
RUN pip install --no-cache-dir --upgrade -r requirements.txt
# Create uploads directory
RUN mkdir -p uploads
# Start the application
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]