Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files6 unmodified lines78910111011121314152 unmodified lines1819202223242526212822233031323324253536372627282930403132334344454647484950513435363754383940575841426061626364434445464748694950727374515253545556577958596 unmodified lines make \ g++ \ wget \ git \ findutils \ curl \ xz-utils \ findutils \ && rm -rf /var/lib/apt/lists/*
# Set working directory2 unmodified lines# 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# CUSTOM DEEPCASTLE ENGINE BUILD (From your src)# ============================================================RUN echo "Cloning Stockfish 17 Stable branch..." && \ git clone --depth 1 --branch sf_17 https://github.com/official-stockfish/Stockfish.git /app/clean_engine
WORKDIR /app/clean_engine/srcWORKDIR /app/engine/srcRUN make -j$(nproc) build ARCH=x86-64-modern && \ mkdir -p /app/engine && \ cp stockfish /app/engine/deepcastle && \ chmod +x /app/engine/deepcastle mkdir -p /app/engine_bin && \ cp stockfish /app/engine_bin/deepcastle && \ chmod +x /app/engine_bin/deepcastle
# ============================================================# LAUNCHER PREPARATION (The Search & Destroy Fix)# LAUNCHER PREPARATION# ============================================================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; \ fiRUN LAUNCHER_PATH=$(find /app -name "main.py" | head -n 1) && \ cp "$LAUNCHER_PATH" /app/launcher.py
# ============================================================# BRAIN PLACEMENT (The Custom Sync)# BRAIN PLACEMENT# ============================================================# Map your custom brain (output.nnue) correctly for the serverRUN mkdir -p /app/engine && \ find /app -maxdepth 1 -name "*.nnue" -exec cp {} /app/engine/output.nnue \; || echo "No custom NNUE found."RUN find /app -maxdepth 2 -name "*.nnue" -exec cp {} /app/engine_bin/output.nnue \; || echo "No custom NNUE found."
# Download standard brains as fallback into the engine folderWORKDIR /app/engineRUN wget -q https://tests.stockfishchess.org/api/nn/nn-9a0cc2a62c52.nnue && \ wget -q https://tests.stockfishchess.org/api/nn/nn-47fc8b7fff06.nnue && \ chmod -R 777 /app/engine# Force permissions for the binary and brainRUN chmod -R 777 /app/engine_bin
# ============================================================# BACKEND SETUP# ============================================================WORKDIR /appRUN pip install --no-cache-dir fastapi uvicorn chess==1.11.2 pydantic
# Explicit Paths for Engine & BrainENV ENGINE_PATH=/app/engine/deepcastleENV NNUE_PATH=/app/engine/output.nnue# Explicit Paths for DeepCastleENV ENGINE_PATH=/app/engine_bin/deepcastleENV NNUE_PATH=/app/engine_bin/output.nnueENV PYTHONPATH="/app:/app/server"
EXPOSE 7860
# START: Use the guaranteed launcher in the root# STARTCMD ["python3", "/app/launcher.py"]Dockerfile+17-38