SFM2001/spititout
0
1FROM node:22-bookworm AS frontend2 3WORKDIR /app4COPY package*.json ./5RUN npm install6COPY . .7RUN npm run build8 9FROM python:3.11-slim10 11ENV PORT=7860 \12 LLM_BACKEND=llamacpp \13 TEXT_MODEL=Qwen/Qwen3-1.7B \14 GGUF_MODEL_REPO=bartowski/Qwen_Qwen3-1.7B-GGUF \15 GGUF_MODEL_FILE=Qwen_Qwen3-1.7B-Q4_K_M.gguf \16 LLAMA_CPP_N_CTX=1024 \17 LLAMA_CPP_N_THREADS=2 \18 ASR_MODEL=openai/whisper-tiny \19 KOKORO_LANG_CODE=z \20 KOKORO_VOICE=zf_xiaobei \21 MAX_NEW_TOKENS=120 \22 LLM_API_BASE_URL=https://api.deepseek.com \23 LLM_API_MODEL=deepseek-v4-flash \24 HF_HOME=/app/.cache/huggingface \25 HUGGINGFACE_HUB_CACHE=/app/.cache/huggingface/hub \26 TRANSFORMERS_CACHE=/app/.cache/huggingface/transformers27 28WORKDIR /app29 30RUN apt-get update \31 && apt-get install -y --no-install-recommends \32 ffmpeg \33 git \34 espeak-ng \35 build-essential \36 cmake \37 && rm -rf /var/lib/apt/lists/*38 39COPY requirements.txt .40 41RUN pip install --no-cache-dir --upgrade pip setuptools wheel \42 && pip install --no-cache-dir -r requirements.txt \43 && pip install --no-cache-dir --prefer-binary \44 --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu \45 llama-cpp-python46 47RUN python - <<'PY'48import os49from huggingface_hub import hf_hub_download50 51path = hf_hub_download(52 repo_id=os.environ["GGUF_MODEL_REPO"],53 filename=os.environ["GGUF_MODEL_FILE"],54)55print("Downloaded model to:", path)56PY57 58COPY app.py .59COPY --from=frontend /app/dist ./dist60 61EXPOSE 786062CMD ["python", "app.py"]