Spaces:
Sleeping
Sleeping
Download rust/ct-bot/Dockerfile from tchauffi/ChessTransformer: direct link, hf CLI and curl.
- Browser
- Download file 1.38 kB
-
https://huggingface.co/spaces/tchauffi/ChessTransformer/resolve/main/rust/ct-bot/Dockerfile
- Command line
-
hf download hf://spaces/tchauffi/ChessTransformer/rust/ct-bot/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/tchauffi/ChessTransformer/resolve/main/rust/ct-bot/Dockerfile
1.38 kB
| # Rust backend for the ChessTransformer web app (replaces backend/Dockerfile). | |
| # Build from the repo root: docker build -f rust/ct-bot/Dockerfile . | |
| FROM rust:1.92-slim-trixie AS builder | |
| # ort's build script downloads the prebuilt ONNX Runtime over TLS (via ureq + | |
| # native-tls, hence libssl-dev/pkg-config at build time). | |
| # g++ provides libstdc++, which the statically-linked ONNX Runtime needs at link time. | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| pkg-config ca-certificates libssl-dev g++ && rm -rf /var/lib/apt/lists/* | |
| WORKDIR /build | |
| COPY rust/ ./rust/ | |
| RUN cargo build --release --manifest-path rust/Cargo.toml -p ct-bot | |
| FROM debian:trixie-slim | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| curl ca-certificates && rm -rf /var/lib/apt/lists/* | |
| WORKDIR /app | |
| COPY --from=builder /build/rust/target/release/ct-bot /usr/local/bin/ct-bot | |
| # ONNX Runtime (CPU) is statically linked; only the model is needed at runtime. | |
| # Base int8 model — the single model used across all deliveries (default, serve, | |
| # lichess): ~1.75x faster on the CPU EP, and the base net scales with search far | |
| # better than EMA (generate with: export_onnx.py <dir> --quantize). | |
| COPY data/models/pos2move_v2.1/model.int8.onnx ./model.int8.onnx | |
| EXPOSE 5001 | |
| ENV RUST_LOG=info | |
| CMD ["ct-bot", "serve", "--model", "/app/model.int8.onnx", "--port", "5001"] | |