Skip to content

Commit

Permalink
Introducing healthcheck to reduce latency issues with different avail…
Browse files Browse the repository at this point in the history
…abilities of wordpress
  • Loading branch information
ArneTR committed Jan 13, 2025
1 parent f48a11f commit b78e9b5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
11 changes: 10 additions & 1 deletion energy-tests/compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ services:
- MYSQL_PASSWORD=wordpress
expose:
- 3306
healthcheck:
test: [
"CMD", "bash", "-c", "mysqladmin ping -h localhost -u wordpress -pwordpress | grep \"mysqld is alive\""
]
interval: "1h" # effectively turns repeated healthchecks during runtime off
start_period: "60s"
start_interval: "1s"

gcb-wordpress-apache:
build:
context: .
Expand All @@ -31,5 +39,6 @@ services:
- WORDPRESS_DB_PASSWORD=wordpress
- WORDPRESS_DB_NAME=wordpress
depends_on:
- gcb-wordpress-mariadb
gcb-wordpress-mariadb:
condition: service_healthy

3 changes: 3 additions & 0 deletions energy-tests/usage_scenario.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ services:
- cp /tmp/repo/energy-tests/puppeteer-flow.js /var/www/puppeteer-flow.js
networks:
- gcb-wordpress-mariadb-network
depends_on:
gcb-wordpress-mariadb:
condition: service_healthy

flow:
- name: Check Website
Expand Down

0 comments on commit b78e9b5

Please sign in to comment.