All tutorials

Docker kontejnerizované nasazení

Nasazení HashRelay serveru a klienta pomocí Docker Compose.

The supported install path is the shell installer. The repository does not ship a maintained Compose file. The deployment notes include a Dockerfile sketch, but that sketch still publishes the old 8443/8444 ports. Use the ports from the current installer and server.toml.example.

Image

dockerfile
FROM rust:1.85-slim AS builder
WORKDIR /app
COPY . .
RUN cargo build -p server --release

FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y ca-certificates && rm -rf /var/lib/apt/lists/*
COPY --from=builder /app/target/release/hr-server /usr/local/bin/hr-server
ENTRYPOINT ["hr-server", "--config", "/etc/hash-relay/server.toml"]

Run

Mount a real server.toml and a data directory for SQLite and certificates. Publish TCP 8555, UDP 9555, and the admin port you set (8585 by default).

yaml
services:
  hr-server:
    image: hash-relay-server
    restart: unless-stopped
    ports:
      - "8555:8555"
      - "9555:9555/udp"
      - "8585:8585"
    volumes:
      - ./server.toml:/etc/hash-relay/server.toml:ro
      - ./data:/var/lib/hash-relay
    environment:
      RUST_LOG: info
Inside the container, [server.database] url and [server.enc] cache_dir must point at the mounted data directory, not a path that disappears when the container exits. [server.api] listen should match how you publish 8585. Health check from the deployment notes: GET /api/v1/system/health on the API port.

A client container is the same idea: hr-client, client.toml, and host networking or a published listen port for each miner mapping. Most farms should keep the client on the miner LAN with the shell installer, not in a cloud container the miners cannot route to.