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"]