Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aggressive healthchecking #209

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
30 changes: 15 additions & 15 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ x-common-environment: &common-environment

x-healthcheck: &healthcheck
test: ["CMD-SHELL", "curl http://localhost/health > /dev/null"]
interval: 5s
timeout: 5s
retries: 5
interval: 1s
timeout: 1s
retries: 25

x-database-dependency: &database-dependency
database:
Expand All @@ -37,9 +37,9 @@ services:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "curl http://localhost > /dev/null"]
interval: 10s
timeout: 10s
retries: 11
interval: 1s
timeout: 1s
retries: 110
ports:
- "80:80"

Expand All @@ -58,9 +58,9 @@ services:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "curl http://localhost/health > /dev/null"]
interval: 5s
timeout: 5s
retries: 5
interval: 1s
timeout: 1s
retries: 25
ports:
- "8080:80" # this is how the front end talks to the api

Expand Down Expand Up @@ -136,9 +136,9 @@ services:
- 'cache:/bitnami/redis/data'
healthcheck:
test: [ "CMD", "redis-cli", "--raw", "incr", "ping" ]
interval: 5s
timeout: 5s
retries: 5
interval: 1s
timeout: 1s
retries: 25

database:
image: "postgres:14-bullseye"
Expand All @@ -149,9 +149,9 @@ services:
- 'database:/var/lib/postgresql/data'
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
interval: 1s
timeout: 1s
retries: 25

volumes:
cache:
Expand Down
4 changes: 2 additions & 2 deletions scripts/test
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,13 @@ e2e() {
./scripts/local down
./scripts/local daemonize

COUNT=24 # 12x5 minute periods = 2 minutes
COUNT=120
for COUNTER in $(seq ${COUNT}); do
if [[ $(docker inspect "$(docker ps | rg arad-front-end-react-1 | cut -d' ' -f1)" --format '{{ .State.Health.Status }}') == "healthy" ]]; then
break
else
echo "waiting for front-end to spin up..."
sleep 5
sleep 1
fi
done

Expand Down