Nova-Voice-chat / Dockerfile
Keeby-smilyai's picture
Update Dockerfile
2b46808 verified
FROM python:3.11-slim
# Install system dependencies for audio processing
RUN apt-get update && apt-get install -y --no-install-recommends \
libsndfile1 \
ffmpeg \
&& rm -rf /var/lib/apt/lists/*
# Create non-root user for Hugging Face Spaces compatibility
RUN useradd -m -u 1000 user
# Set environment variables
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH \
PYTHONUNBUFFERED=1 \
STREAMLIT_BROWSER_GATHER_USAGE_STATS=false \
HF_HOME=/tmp/huggingface_cache
# Set working directory
WORKDIR $HOME/app
# Copy files as non-root user
COPY --chown=user . $HOME/app
# Install Python dependencies as non-root user
RUN pip install --no-cache-dir --user -r requirements.txt
# Switch to non-root user
USER user
# Expose Streamlit default port
EXPOSE 8501
# Health check
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health || exit 1
# Run the app on Streamlit's default port
CMD ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]