Skip to content

Instantly share code, notes, and snippets.

@iDVB
Last active October 24, 2018 00:51
Show Gist options
  • Save iDVB/ddb2f637ff9a0b3452976653bca09f85 to your computer and use it in GitHub Desktop.
Save iDVB/ddb2f637ff9a0b3452976653bca09f85 to your computer and use it in GitHub Desktop.
WebPageTest local
version: "2"
services:
server:
image: webpagetest/server:latest
volumes:
- ./server/locations.ini:/var/www/html/settings/locations.ini
agent:
image: webpagetest/agent:latest
environment:
SERVER_URL: http://server/work/
LOCATION: Test
volumes:
- ./agent/entrypoint.sh:/entrypoint.sh
entrypoint: /entrypoint.sh
depends_on:
- server
test:
image: klickinc/webpagetestapi:master
command: test https://twitter.com/marcelduran --server http://server:80 --poll 5 --timeout 60
depends_on:
- server
- agent
#!/bin/bash
set -e
if [ -z "$SERVER_URL" ]; then
echo >&2 'SERVER_URL not set'
exit 1
fi
if [ -z "$LOCATION" ]; then
echo >&2 'LOCATION not set'
exit 1
fi
if [ -z "$EXTRA_ARGS" ]; then
EXTRA_ARGS=""
fi
if [ -n "$NAME" ]; then
EXTRA_ARGS="$EXTRA_ARGS --name $NAME"
fi
if [ -n "$KEY" ]; then
EXTRA_ARGS="$EXTRA_ARGS --key $KEY"
fi
if [ -n "$SHAPER" ]; then
EXTRA_ARGS="$EXTRA_ARGS --shaper $SHAPER"
fi
# exec replaces the shell process by the python process and is required to
# propagate signals (i.e. SIGTERM)
exec python /wptagent/wptagent.py --server "${SERVER_URL}" --location "${LOCATION}" ${EXTRA_ARGS} --xvfb --dockerized
[locations]
1=Test_loc
[Test_loc]
1=Test
label=Test Location
group=Desktop
[Test]
browser=Chrome,Firefox
label="Test Location"
connectivity=LAN
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment