mirror of
https://github.com/Nighthawk42/fulloch.git
synced 2026-08-30 08:02:28 +00:00
50 lines
1.3 KiB
Plaintext
50 lines
1.3 KiB
Plaintext
# Stage 1: Build compiled CUDA extensions
|
|
FROM pytorch/pytorch:2.8.0-cuda12.8-cudnn9-devel AS builder
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
ENV CMAKE_ARGS="-DGGML_CUDA=on"
|
|
ENV FORCE_CMAKE=1
|
|
|
|
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
|
|
|
|
COPY requirements.txt /tmp/requirements.txt
|
|
RUN pip install --no-cache-dir -r /tmp/requirements.txt && \
|
|
pip install --no-deps git+https://github.com/rekuenkdr/Qwen3-TTS-streaming.git@97da215 && \
|
|
pip install flash-attn --no-build-isolation
|
|
|
|
# Stage 2: Runtime (no CUDA compilers/headers)
|
|
FROM pytorch/pytorch:2.8.0-cuda12.8-cudnn9-runtime
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
WORKDIR /app
|
|
|
|
ENV HF_HOME=/app/data/models
|
|
ENV HF_HUB_OFFLINE=1
|
|
|
|
# Install runtime system dependencies
|
|
RUN apt-get update && apt-get install -y \
|
|
sox \
|
|
libsox-dev \
|
|
libsox-fmt-all \
|
|
ffmpeg \
|
|
libportaudio2 \
|
|
procps \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Copy Python environment with compiled packages from builder
|
|
COPY --from=builder /opt/conda /opt/conda
|
|
|
|
# Create non-root user
|
|
RUN useradd -m -u 1000 -s /bin/bash appuser
|
|
USER appuser
|
|
|
|
# Copy application code
|
|
COPY --chown=appuser:appuser app.py .
|
|
COPY --chown=appuser:appuser core/ core/
|
|
COPY --chown=appuser:appuser tools/ tools/
|
|
COPY --chown=appuser:appuser utils/ utils/
|
|
COPY --chown=appuser:appuser audio/ audio/
|
|
|
|
CMD ["python", "app.py"]
|