File size: 1,439 Bytes
5f422c9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
FROM python:3.11-slim

# --- Environment ---
ENV DEBIAN_FRONTEND=noninteractive
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
ENV PORT=7860
ENV DEVICE=cpu
ENV DISPLAY=""
ENV GRADIO_SERVER_NAME=0.0.0.0
# Requied for MCP and API
ENV PATH="/app/env/bin:$PATH"
ENV PYTHONPATH="/app/src"

# --- System deps ---
RUN apt-get update && apt-get install -y --no-install-recommends \
    git \
    wget \
    bash \
    build-essential \
    libgl1 \
    libglib2.0-0 \
    && rm -rf /var/lib/apt/lists/*

# --- Install uv ---
RUN pip install --no-cache-dir uv

# --- App setup ---
WORKDIR /app

RUN git clone --depth 1 https://github.com/rupeshs/fastsdcpu.git .

# WebUI Hack
RUN sed -i 's/webui.launch(share=share)/webui.launch(share=share, server_name="0.0.0.0", server_port=7860)/' src/frontend/webui/ui.py \
 && sed -i 's/demo.launch(share=share)/demo.launch(share=share, server_name="0.0.0.0", server_port=7860)/' src/frontend/webui/realtime_ui.py
 
# --- Fix scripts + install ---
RUN chmod +x install.sh start-webui.sh start-webserver.sh \
    && sed -i '/read -n1 -r -p/d' install.sh \
    && ./install.sh --disable-gui



# --- Expose port ---
EXPOSE 7860

# --- Runtime ---
# WebUI
# CMD ["bash", "./start-webui.sh" , "--host", "0.0.0.0", "--port", "7860"]
# API
CMD ["uvicorn", "backend.api.web:app", "--host", "0.0.0.0", "--port", "7860"]
# MCP
#CMD ["uvicorn", "backend.api.mcp_server:app", "--host", "0.0.0.0", "--port", "7860"]