@@ -27,6 +27,7 @@ RUN apt-get update && \
2727 apt-transport-https \
2828 gnupg \
2929 software-properties-common \
30+ dos2unix \
3031 # Build tools
3132 build-essential \
3233 git \
@@ -65,26 +66,30 @@ RUN python3 -m pip install --no-cache-dir --upgrade pip && \
6566 rm /requirements.txt
6667
6768# ==============================================================================
68- # Copy Application Files
69+ # Copy Application Files and Fix Line Endings
6970# ==============================================================================
7071COPY src/rp_handler.py /rp_handler.py
7172COPY scripts/start.sh /start.sh
72- RUN chmod +x /start.sh
73+
74+ # CRITICAL: Remove BOM and fix line endings
75+ RUN dos2unix /start.sh && \
76+ chmod +x /start.sh && \
77+ dos2unix /rp_handler.py || true
7378
7479# ==============================================================================
7580# Expose SwarmUI Port
7681# ==============================================================================
7782EXPOSE ${SWARMUI_PORT}
7883
7984# ==============================================================================
80- # Health Check
85+ # Health Check - Use POST with session_id
8186# ==============================================================================
8287HEALTHCHECK --interval=30s --timeout=10s --start-period=1800s --retries=3 \
83- CMD curl -f http://localhost:${SWARMUI_PORT}/API/ListBackends || exit 1
84-
88+ CMD curl -f -X POST http://localhost:${SWARMUI_PORT}/API/GetNewSession \
89+ -H "Content-Type: application/json" \
90+ -d '{}' || exit 1
91+
8592# ==============================================================================
8693# Start Script and Handler
8794# ==============================================================================
88- # Run start.sh in background to install/launch SwarmUI
89- # Then run handler in foreground to process RunPod jobs
9095CMD ["/bin/bash" , "-c" , "/start.sh & python3 -u /rp_handler.py" ]
0 commit comments