Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions deploy/docker-compose.production-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ services:
redis_host: ${REDIS_HOST}
postgresql_server: ${POSTGRESQL_HOST}
validTestDomains: ${VALID_TEST_DOMAINS}
volumes:
- ../server/config/server.yaml:/usr/src/app/config/server.yaml:ro
ports:
- "3000:3000"
restart: always
Expand Down
22 changes: 22 additions & 0 deletions deploy/docker-compose.production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,23 @@ services:
interval: 5s
timeout: 3s
retries: 30
grafana:
image: grafana/grafana:13.2.0
restart: always
ports:
- "3000:3000"
environment:
- GF_SECURITY_ALLOW_EMBEDDING=true
- POSTGRESQL_USER=${POSTGRESQL_USER}
- POSTGRESQL_PASSWORD=${POSTGRESQL_PASSWORD}
- POSTGRESQL_DB=${POSTGRESQL_DB}
volumes:
- grafana-data:/var/lib/grafana
- ../grafana/datasources:/etc/grafana/provisioning/datasources:ro
- ../grafana/dashboards:/etc/grafana/provisioning/dashboards:ro
- ../grafana/dashboards:/var/lib/grafana/dashboards:ro
networks:
- skynet
postgresql:
image: postgres:${POSTGRESQL_DOCKER_VERSION}
restart: always
Expand Down Expand Up @@ -88,6 +105,10 @@ services:
redis_host: ${REDIS_HOST}
postgresql_server: ${POSTGRESQL_HOST}
validTestDomains: ${VALID_TEST_DOMAINS}
volumes:
- ../server/config/server.yaml:/usr/src/app/config/server.yaml:ro
ports:
- "3001:3000"
restart: always
networks:
- skynet
Expand Down Expand Up @@ -147,6 +168,7 @@ volumes:
driver: local
caddy_data:
caddy_config:
grafana-data:
networks:
skynet:
name: skynet
8 changes: 4 additions & 4 deletions deploy/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,17 +105,17 @@ if [ -n "$VERSION" ]; then
fi

echo ">> Pulling images (mode=$MODE)…"
docker compose "${COMPOSE_FILES[@]}" pull
docker compose --env-file "$REPO_ROOT/.env" "${COMPOSE_FILES[@]}" pull

echo ">> Restarting services…"
docker compose "${COMPOSE_FILES[@]}" up -d --remove-orphans
docker compose --env-file "$REPO_ROOT/.env" "${COMPOSE_FILES[@]}" up -d --remove-orphans

echo ">> Container status:"
docker compose "${COMPOSE_FILES[@]}" ps
docker compose --env-file "$REPO_ROOT/.env" "${COMPOSE_FILES[@]}" ps

echo ">> Tailing logs for 10 seconds (Ctrl+C to keep watching)…"
# `timeout` returns 124 when it kills the process — that's the success path
# here, so swallow the non-zero exit. Plain `|| true` keeps `set -e` happy.
timeout 10 docker compose "${COMPOSE_FILES[@]}" logs --tail 30 -f || true
timeout 10 docker compose --env-file "$REPO_ROOT/.env" "${COMPOSE_FILES[@]}" logs --tail 30 -f || true

echo ">> Done."
24 changes: 24 additions & 0 deletions grafana/dashboards/default.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: 1

providers:
# <string> an unique provider name. Required
- name: 'sitespeed.io'
# <int> Org id. Default to 1
orgId: 1
# <string> name of the dashboard folder.
folder: 'sitespeed.io'
# <string> folder UID. will be automatically generated if not specified
folderUid: ''
# <string> provider type. Default to 'file'
type: file
# <bool> disable dashboard deletion
disableDeletion: false
# <int> how often Grafana will scan for changed dashboards
updateIntervalSeconds: 10
# <bool> allow updating provisioned dashboards from the UI
allowUiUpdates: true
options:
# <string, required> path to dashboard files on disk. Required when using the 'file' type
path: /var/lib/grafana/dashboards
# <bool> use folder names from filesystem to create folders in Grafana
foldersFromFilesStructure: true
25 changes: 25 additions & 0 deletions grafana/datasources/postgres.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# OnlineTest PostgreSQL — URL tables for CWV Group (not Graphite).
# Grafana must be on Docker network `skynet` so host `postgresql` resolves.
# Password comes from the Grafana container env (POSTGRESQL_*).
apiVersion: 1

datasources:
- name: onlinetest-postgres
type: postgres
uid: onlinetest-postgres
access: proxy
orgId: 1
url: postgresql:5432
user: ${POSTGRESQL_USER}
isDefault: false
editable: true
jsonData:
database: ${POSTGRESQL_DB}
sslmode: disable
postgresVersion: 1600
timescaledb: false
maxOpenConns: 10
maxIdleConns: 5
connMaxLifetime: 14400
secureJsonData:
password: ${POSTGRESQL_PASSWORD}
18 changes: 17 additions & 1 deletion server/config/server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,20 @@ queue:

# If you don't setup a default sitespeed.io configuration, you can add
# your sitespeed.io configuration directly in this block
sitespeed.io:
sitespeed.io:
slug: default
browsertime:
iterations: 1
video: false
visualMetrics: false
screenshot: false
screenshotLCP: false
screenshotLS: false
pageCompleteWaitTime: 300
chrome:
args:
- "--headless=new"
- "--blink-settings=imagesEnabled=false"
- "--disable-dev-shm-usage"
- "--no-sandbox"
- "--disable-gpu"