Docker support for a server that behaves as a standalone frontend AND a backend for another server.
This commit is contained in:
parent
82d64bff96
commit
20f1f46d1f
|
@ -104,3 +104,10 @@ This command starts LibreSpeed in frontend mode, with a given `servers.json` fil
|
||||||
```
|
```
|
||||||
docker run -e MODE=frontend -e TELEMETRY=true -e ENABLE_ID_OBFUSCATION=true -e PASSWORD="yourPasswordHere" -v $(pwd)/servers.json:/servers.json -p 80:80 -it adolfintel/speedtest
|
docker run -e MODE=frontend -e TELEMETRY=true -e ENABLE_ID_OBFUSCATION=true -e PASSWORD="yourPasswordHere" -v $(pwd)/servers.json:/servers.json -p 80:80 -it adolfintel/speedtest
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Dual mode
|
||||||
|
In dual mode, LibreSpeed operates as a standalone server that can also connect to other test points.
|
||||||
|
To do this:
|
||||||
|
* Set the `MODE` environment variable to `dual`
|
||||||
|
* Follow the `servers.json` instructions for the frontend mode
|
||||||
|
* The first server entry should be the local server, using the server endpoint address that a client can access.
|
|
@ -13,7 +13,7 @@ cp /speedtest/*.js /var/www/html/
|
||||||
cp /speedtest/favicon.ico /var/www/html/
|
cp /speedtest/favicon.ico /var/www/html/
|
||||||
|
|
||||||
# Set up backend side for standlone modes
|
# Set up backend side for standlone modes
|
||||||
if [ "$MODE" == "standalone" ]; then
|
if [[ "$MODE" == "standalone" || "$MODE" == "dual" ]]; then
|
||||||
cp -r /speedtest/backend/ /var/www/html/backend
|
cp -r /speedtest/backend/ /var/www/html/backend
|
||||||
if [ ! -z "$IPINFO_APIKEY" ]; then
|
if [ ! -z "$IPINFO_APIKEY" ]; then
|
||||||
sed -i s/\$IPINFO_APIKEY\ =\ \'\'/\$IPINFO_APIKEY\ =\ \'$IPINFO_APIKEY\'/g /var/www/html/backend/getIP_ipInfo_apikey.php
|
sed -i s/\$IPINFO_APIKEY\ =\ \'\'/\$IPINFO_APIKEY\ =\ \'$IPINFO_APIKEY\'/g /var/www/html/backend/getIP_ipInfo_apikey.php
|
||||||
|
@ -28,14 +28,14 @@ if [ "$MODE" == "backend" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Set up index.php for frontend-only or standalone modes
|
# Set up index.php for frontend-only or standalone modes
|
||||||
if [ "$MODE" == "frontend" ]; then
|
if [[ "$MODE" == "frontend" || "$MODE" == "dual" ]]; then
|
||||||
cp /speedtest/frontend.php /var/www/html/index.php
|
cp /speedtest/frontend.php /var/www/html/index.php
|
||||||
elif [ "$MODE" == "standalone" ]; then
|
elif [ "$MODE" == "standalone" ]; then
|
||||||
cp /speedtest/standalone.php /var/www/html/index.php
|
cp /speedtest/standalone.php /var/www/html/index.php
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Apply Telemetry settings when running in standalone or frontend mode and telemetry is enabled
|
# Apply Telemetry settings when running in standalone or frontend mode and telemetry is enabled
|
||||||
if [[ "$TELEMETRY" == "true" && ( "$MODE" == "frontend" || "$MODE" == "standalone" ) ]]; then
|
if [[ "$TELEMETRY" == "true" && ( "$MODE" == "frontend" || "$MODE" == "standalone" || "$MODE" == "dual" ) ]]; then
|
||||||
cp -r /speedtest/results /var/www/html/results
|
cp -r /speedtest/results /var/www/html/results
|
||||||
|
|
||||||
if [ "$MODE" == "frontend" ]; then
|
if [ "$MODE" == "frontend" ]; then
|
||||||
|
|
Loading…
Reference in a new issue