Spaces:
Sleeping
Sleeping
Upload Dockerfile
Browse files8 unmodified lines9101112131415161718171920212221232423242526272829303132332526272829303132333435363738394041424344374546474841424950515253545548565758596061628 unmodified lines wget \ git \ findutils \ curl \ xz-utils \ && rm -rf /var/lib/apt/lists/*
# Set working directoryWORKDIR /app
# Copy ALL files from the repository# Copy ALL files from the repository (to get the NNUE and server files)COPY . .
# ============================================================# BULLETPROOF ENGINE BUILD (Optimized for Deepcastle v7)# GOD-TIER ENGINE BUILD (Self-Healing Source Hijack)# ============================================================RUN echo "Commencing Engine Build..." && \ MAKE_PATH=$(find . -name "Makefile" | head -n 1) && \ if [ -n "$MAKE_PATH" ]; then \ MAKE_DIR=$(dirname "$MAKE_PATH"); \ cd "$MAKE_DIR" && \ echo "Building in $MAKE_DIR..." && \ make -j$(nproc) build ARCH=x86-64-sse41-popcnt || echo "Source build failed!"; \ if [ -f "stockfish" ]; then \ mkdir -p /app/engine && \ cp stockfish /app/engine/deepcastle; \ fi; \# 1. Clone a fresh, clean Stockfish repository (avoids missing local scripts)RUN echo "Cloning fresh engine source..." && \ git clone --depth 1 https://github.com/official-stockfish/Stockfish.git /app/clean_engine
# 2. Overwrite the engine with your custom Deepcastle network (if it exists)RUN if [ -f "/app/engine/output.nnue" ]; then \ echo "Successfully found custom Deepcastle NNUE. Hijacking clean source..."; \ cp /app/engine/output.nnue /app/clean_engine/src/deepcastle.nnue; \ fi
# 3. Build the engine in the clean directory# We use ARCH=x86-64-sse41-popcnt (Very compatible with cloud)# We disable the network fetch (since we provide it)WORKDIR /app/clean_engine/srcRUN make -j$(nproc) build ARCH=x86-64-sse41-popcnt && \ mkdir -p /app/engine && \ cp stockfish /app/engine/deepcastle && \ echo "Engine build complete!"
# ============================================================# FAILSAFE: Linux Binary (Reliable Mirror)# FALLBACK: Linux Binary (Alternative Mirror)# ============================================================WORKDIR /app/engineRUN if [ ! -f "deepcastle" ]; then \ echo "Using Failsafe: Downloading Rock-Solid Linux Release..."; \ wget https://github.com/official-stockfish/Stockfish/releases/download/sf_17/stockfish-ubuntu-x86-64-sse41-popcnt.tar.xz && \ echo "Using Failsafe: Downloading Rock-Solid Linux Release SF 16.1..."; \ wget https://github.com/official-stockfish/Stockfish/releases/download/sf_16.1/stockfish-ubuntu-x86-64-sse41-popcnt.tar.xz && \ tar -xvf stockfish-ubuntu-x86-64-sse41-popcnt.tar.xz && \ cp stockfish/stockfish-ubuntu-x86-64-sse41-popcnt deepcastle && \ rm -rf stockfish*; \ fi && chmod +x deepcastle
# Fallback: NNUEoptimized brain# Ensure NNUE exists in the engine directory for runtime# (Deepcastle v7 uses output.nnue) RUN if [ ! -f "output.nnue" ]; then \ echo "Brain missing. Downloading specialized NNUE..." && \ wget https://tests.stockfishchess.org/api/nn/nn-ae6a455a-c521-4f11-923f-5626359074df.nnue -O output.nnue; \ fi
Dockerfile+27-17