whisper-websocket / Dockerfile
AnyaSchen's picture
Add application file
72277b5
raw
history blame
1.24 kB
# Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
# you will also find guides on how best to write your Dockerfile
FROM python:3.10-slim
# Install system dependencies
RUN apt-get update && apt-get install -y \
build-essential \
git \
curl \
ffmpeg \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean
# Set working directory
WORKDIR /app
# Create static directory and set permissions
RUN mkdir -p /app/static && chmod 777 /app/static
# Create a non-root user
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"
# Copy requirements first to leverage Docker cache
COPY --chown=user requirements.txt .
RUN pip install --no-cache-dir --upgrade -r requirements.txt
# Copy application files
COPY --chown=user *.py /app/
COPY --chown=user whisper_streaming_custom /app/whisper_streaming_custom/
COPY --chown=user diarization /app/diarization/
COPY --chown=user static /app/static/
# Set environment variables
ENV PYTHONPATH=/app
ENV PYTHONUNBUFFERED=1
# Expose the port the server runs on
EXPOSE 7860
# Run the server using main.py
CMD ["python", "main.py", "--host", "0.0.0.0", "--port", "7860", "--model", "tiny", "--backend", "faster-whisper", "--task", "transcribe"]