Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files2 unmodified lines3456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172732 unmodified lines# Install system dependenciesRUN apt-get update && apt-get install -y \build-essential \make \g++ \wget \git \findutils \curl \xz-utils \&& rm -rf /var/lib/apt/lists/*# Set working directoryWORKDIR /app# Copy ALL files from the repositoryCOPY . .# DEBUG: List all files to see what actually arrived from GitHubRUN echo "--- REPOSITORY CONTENT DEBUG ---" && \ls -R /app && \echo "---------------------------------"# ============================================================# DUAL-BRAIN ENGINE BUILD# ============================================================RUN echo "Cloning fresh engine source..." && \git clone --depth 1 https://github.com/official-stockfish/Stockfish.git /app/clean_engineWORKDIR /app/clean_engine/srcRUN make -j$(nproc) build ARCH=x86-64-sse41-popcnt && \mkdir -p /app/engine && \cp stockfish /app/engine/deepcastle && \chmod +x /app/engine/deepcastle# ============================================================# LAUNCHER PREPARATION (The Search & Destroy Fix)# ============================================================WORKDIR /appRUN echo "Searching for Launcher (main.py)..." && \LAUNCHER_PATH=$(find /app -name "main.py" | head -n 1) && \if [ -n "$LAUNCHER_PATH" ]; then \echo "Found launcher at: $LAUNCHER_PATH. Copying to root..."; \cp "$LAUNCHER_PATH" /app/launcher.py; \else \echo "CRITICAL ERROR: main.py not found in the repository!"; \exit 1; \fi# Map any NNUE files found in the repoRUN find /app -name "*.nnue" -exec cp {} /app/engine/custom_big.nnue \; || echo "No custom NNUE found."# Failsafe BrainsWORKDIR /app/engineRUN if [ ! -f "nn-9a0cc2a62c52.nnue" ]; then wget https://tests.stockfishchess.org/api/nn/nn-9a0cc2a62c52.nnue; fi && \if [ ! -f "nn-47fc8b7fff06.nnue" ]; then wget https://tests.stockfishchess.org/api/nn/nn-47fc8b7fff06.nnue; fi# ============================================================# BACKEND SETUP# ============================================================WORKDIR /appRUN pip install fastapi "uvicorn[standard]" websockets python-chess pydantic# Set PYTHONPATH to include all potential source directoriesENV PYTHONPATH="/app:/app/server"EXPOSE 7860# START: Use the guaranteed launcher in the rootCMD ["python3", "/app/launcher.py"]2 unmodified lines34567891011121314151617181920212223242526272829303132333435362 unmodified lines# Install system dependenciesRUN apt-get update && apt-get install -y \build-essential make g++ wget git findutils curl xz-utils \&& rm -rf /var/lib/apt/lists/*WORKDIR /appCOPY . .# Build the EngineRUN git clone --depth 1 https://github.com/official-stockfish/Stockfish.git /app/clean_engineWORKDIR /app/clean_engine/srcRUN make -j$(nproc) build ARCH=x86-64-sse41-popcnt && \mkdir -p /app/engine && \cp stockfish /app/engine/deepcastle && \chmod +x /app/engine/deepcastle# Prepare the LauncherWORKDIR /appRUN LAUNCHER_PATH=$(find /app -name "main.py" | head -n 1) && \cp "$LAUNCHER_PATH" /app/launcher.py# ============================================================# THE FIX: Added 'websockets' here# ============================================================RUN pip install --no-cache-dir fastapi "uvicorn[standard]" python-chess pydantic websockets# Set weights and environmentENV PYTHONPATH="/app:/app/server"ENV ENGINE_PATH="/app/engine/deepcastle"EXPOSE 7860# THE FIX: Run with uvicorn directly for better health detectionCMD ["uvicorn", "launcher:app", "--host", "0.0.0.0", "--port", "7860"]
Dockerfile+12-49