tts-gpu-service / Dockerfile-websocket
Peter Michael Gits
feat: Add standalone WebSocket-only TTS service v1.0.0
390e1c5
raw
history blame contribute delete
857 Bytes
# Minimal Dockerfile for WebSocket-only TTS service
FROM python:3.11-slim
# Set working directory
WORKDIR /app
# Install minimal system packages
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean
# Create non-root user
RUN useradd -m -u 1000 user
# Switch to user
USER user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
WORKDIR $HOME/app
# Copy and install minimal requirements
COPY --chown=user requirements-websocket.txt .
RUN pip install --user --no-cache-dir -r requirements-websocket.txt
# Copy WebSocket server
COPY --chown=user websocket_tts_server.py .
# Expose port
EXPOSE 7860
# Environment variables
ENV GRADIO_SERVER_NAME="0.0.0.0" \
GRADIO_SERVER_PORT=7860
# Run WebSocket-only TTS service
CMD ["python3", "websocket_tts_server.py"]