User Tools

Site Tools


docker:docker-compose:librespeed

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
docker:docker-compose:librespeed [2026/02/20 16:27] – created jonathandocker:docker-compose:librespeed [2026/02/20 16:36] (current) – created jonathan
Line 1: Line 1:
 +=====librespeed=====
  
 +==== Server ====
 +<code - docker-compose.yaml>
 +---
 +services:
 +  librespeed:
 +    image: lscr.io/linuxserver/librespeed:latest
 +    container_name: librespeed
 +    environment:
 +      - PUID=1000
 +      - PGID=1000
 +      - TZ=America/Toronto
 +      - PASSWORD=MyPassword123!
 +#      - CUSTOM_RESULTS=false #optional
 +#      - DB_TYPE=sqlite #optional
 +#      - DB_NAME=DB_NAME #optional
 +#      - DB_HOSTNAME=DB_HOSTNAME #optional
 +#      - DB_USERNAME=DB_USERNAME #optional
 +#      - DB_PASSWORD=DB_PASSWORD #optional
 +#      - DB_PORT=DB_PORT #optional
 +#      - IPINFO_APIKEY=ACCESS_TOKEN #optional
 +    volumes:
 +      - ./config:/config
 +    ports:
 +      - 8083:80
 +    restart: unless-stopped
 +</code>
 +
 +
 +==== CLI client ====
 +
 +<code - Dockerfile>
 +FROM golang:1.24-alpine as builder
 +RUN apk add --no-cache bash upx git
 +WORKDIR /usr/src/librespeed-cli
 +COPY . .
 +RUN ./build.sh
 +
 +FROM alpine:3.17
 +COPY --from=builder /usr/src/librespeed-cli/out/librespeed-cli* /bin/librespeed-cli
 +# Changement ici :
 +CMD ["/bin/librespeed-cli"]
 +</code>
 +
 +<code - Build the speedtest-cli container client>
 +git clone https://github.com/librespeed/speedtest-cli.git
 +cd speedtest-cli
 +docker build -t librespeed-cli:latest .
 +</code>
 +
 +
 +<code - server.json>
 +[
 +  {
 +    "name": "LibreSpeed Local",
 +    "server": "http://192.168.22.4:8083/",
 +    "dlURL": "backend/garbage.php",
 +    "ulURL": "backend/empty.php",
 +    "pingURL": "backend/empty.php",
 +    "getIpURL": "backend/getIP.php"
 +  }
 +]
 +</code>
 +
 +<code - Speedtest #1>
 +jonathan@jonathan-VirtualBox:~$ docker run -it --rm --network host \
 +   -v $(pwd)/server.json:/server.json \
 +   librespeed-cli:latest \
 +   /bin/librespeed-cli --local-json /server.json
 +   
 +Using local JSON server list: /server.json
 +Selecting the fastest server based on ping
 +Selected server: LibreSpeed Local [192.168.22.4]
 +You're testing from: {"processedString":"192.168.22.249 - private IPv4 access","rawIspInfo":""}
 +Ping: 2.45 ms Jitter: 1.45 ms
 +Download rate: 594.31 Mbps
 +Upload rate: 468.81 Mbps
 +jonathan@jonathan-VirtualBox:~$
 +</code>
 +
 +<code - Speedtest #2>
 +jonathan@jonathan-VirtualBox:~$ docker run --rm --network host \
 +   -v $(pwd)/server.json:/server.json \
 +   librespeed-cli:latest \
 +   /bin/librespeed-cli --local-json /server.json --simple
 +   
 +Ping: 1.09 ms Jitter: 0.01 ms
 +Download rate: 653.86 Mbps
 +Upload rate: 462.26 Mbps
 +jonathan@jonathan-VirtualBox:~$
 +</code>