Skip to content

Commit de84674

Browse files
authored
Merge branch 'master' into fix-docker-images
2 parents 29e0686 + 5cad53e commit de84674

File tree

4 files changed

+40
-11
lines changed

4 files changed

+40
-11
lines changed

doc_docker.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ An Alpine Linux based docker version of LibreSpeed is also available here: [GitH
1111
If you just want to try it, the fastest way is:
1212

1313
```shell
14-
docker run -p 80:80 -d --name speedtest --rm ghcr.io/librespeed/speedtest
14+
docker run -p 80:8080 -d --name speedtest --rm ghcr.io/librespeed/speedtest
1515
```
1616

17-
Then go with your browser to port 80 of your server and try it out. If port 80 is already in use, adjust the first number in 80:80 above.
17+
Then go with your browser to port 80 of your server and try it out. If port 80 is already in use, adjust the first number in 80:8080 above.
1818
Default is to run in standalone mode.
1919

2020
## Docker Compose
@@ -41,9 +41,9 @@ services:
4141
#DISABLE_IPINFO: "false"
4242
#IPINFO_APIKEY: "your api key"
4343
#DISTANCE: "km"
44-
#WEBPORT: 80
44+
#WEBPORT: 8080
4545
ports:
46-
- "80:80" # webport mapping (host:container)
46+
- "80:8080" # webport mapping (host:container)
4747
```
4848
4949
Please adjust the environment variables according to the intended operating mode.
@@ -73,7 +73,7 @@ Here's a list of additional environment variables available in this mode:
7373
* __`DISABLE_IPINFO`__: If set to `true`, ISP info and distance will not be fetched from either [ipinfo.io](https://ipinfo.io) or the offline database. Default: value: `false`
7474
* __`IPINFO_APIKEY`__: API key for [ipinfo.io](https://ipinfo.io). Optional, but required if you want to use the full [ipinfo.io](https://ipinfo.io) APIs (required for distance measurement)
7575
* __`DISTANCE`__: When `DISABLE_IPINFO` is set to false, this specifies how the distance from the server is measured. Can be either `km` for kilometers, `mi` for miles, or an empty string to disable distance measurement. Requires an [ipinfo.io](https://ipinfo.io) API key. Default value: `km`
76-
* __`WEBPORT`__: Allows choosing a custom port for the included web server. Default value: `80`. Note that you will have to expose it through docker with the -p argument. This is not the port where the service is exposed outside docker!
76+
* __`WEBPORT`__: Allows choosing a custom port for the included web server. Default value: `8080`. Note that you will have to expose it through docker with the -p argument. This is not the port where the service is exposed outside docker!
7777

7878
If telemetry is enabled, a stats page will be available at `http://your.server/results/stats.php`, but a password must be specified.
7979

@@ -110,7 +110,7 @@ Here's a list of additional environment variables available in this mode:
110110
This command starts LibreSpeed in backend mode, with the default settings, on port 80:
111111

112112
```shell
113-
docker run -e MODE=backend -p 80:80 -it ghcr.io/librespeed/speedtest
113+
docker run -e MODE=backend -p 80:8080 -it ghcr.io/librespeed/speedtest
114114
```
115115

116116
### Frontend mode

docker/entrypoint.sh

+6-2
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,13 @@ cp /speedtest/favicon.ico /var/www/html/
1818

1919
# Set custom webroot on alpine
2020
if is_alpine; then
21+
echo "ALPINE IMAGE"
2122
sed -i "s#\"/var/www/localhost/htdocs\"#\"/var/www/html\"#g" /etc/apache2/httpd.conf
23+
else
24+
echo "DEBIAN IMAGE"
2225
fi
2326

27+
2428
# Set up backend side for standlone modes
2529
if [[ "$MODE" == "standalone" || "$MODE" == "dual" ]]; then
2630
cp -r /speedtest/backend/ /var/www/html/backend
@@ -82,9 +86,9 @@ if [[ "$TELEMETRY" == "true" && ("$MODE" == "frontend" || "$MODE" == "standalone
8286

8387
mkdir -p /database/
8488
if is_alpine; then
85-
chown apache /database/
89+
chown -R apache /database/
8690
else
87-
chown www-data /database/
91+
chown -R www-data /database/
8892
fi
8993
fi
9094

docker/test/docker-compose.yml

+14-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ x-shared:
1111
- TELEMETRY=true
1212

1313
services:
14-
###################### POSTGRESQL ################################
14+
###################### POSTGRESQL ################################
1515
pg:
1616
image: postgres:alpine
1717
environment:
@@ -48,7 +48,7 @@ services:
4848
ports:
4949
- 9124:8080
5050

51-
####################### MYSQL ##############################
51+
####################### MYSQL ##############################
5252

5353
mysql:
5454
image: mysql:lts
@@ -88,7 +88,8 @@ services:
8888
ports:
8989
- 9126:8080
9090

91-
###### SQLITE ######
91+
################ SQLITE ####################################
92+
9293
speedtest-debian-sqlite:
9394
# check at http://localhost:9125/results/sanitycheck.php
9495
build:
@@ -111,6 +112,7 @@ services:
111112
environment: *env_vars_sqlite
112113
ports:
113114
- 9128:8080
115+
114116
speedtest-alpine-sqlite-dual:
115117
<<: *speedtest-service
116118
build:
@@ -123,3 +125,12 @@ services:
123125
- ./servers.json:/servers.json:ro
124126
ports:
125127
- 9129:8080
128+
129+
############## TEST CONTAINER ###############################################################
130+
test-container:
131+
image: alpine
132+
volumes:
133+
- ./test-script.sh:/test-script.sh
134+
command:
135+
- sh
136+
- /test-script.sh

docker/test/test-script.sh

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
PORT=8080
2+
3+
apk add w3m
4+
5+
echo sleeping a little to get things setteled...
6+
sleep 10
7+
8+
for db in sqlite pg mysql; do
9+
for distro in alpine debian; do
10+
hostname=speedtest-$distro-$db
11+
echo $hostname
12+
w3m -dump http://$hostname:$PORT/results/sanitycheck.php|grep -v 'N/A'
13+
done
14+
done

0 commit comments

Comments
 (0)