Skip to content

Commit

Permalink
Use healthcheck instead of waisbrot/wait
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamVyborny committed Jul 10, 2024
1 parent 1d3b8dd commit ee98cae
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
1 change: 0 additions & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ jobs:
- name: Run tests
run: |
export MYSQL_VERSION="${{ matrix.mysql }}"
docker-compose run wait
docker-compose run app
tests-in-kbc:
Expand Down
24 changes: 15 additions & 9 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ services:
- mysql-ssl
- mysql-ssl:mysql-different-cn
- sshproxy
depends_on:
mysql:
condition: service_healthy
mysql-ssl:
condition: service_healthy

dev:
<<: *app
Expand All @@ -38,6 +43,11 @@ services:
environment:
MYSQL_DATABASE: test
MYSQL_ROOT_PASSWORD: rootpassword
healthcheck:
test: [ "CMD", "mysqladmin", "ping", "-h", "localhost" ]
interval: 10s
timeout: 5s
retries: 5

mysql-ssl:
image: mysql:${MYSQL_VERSION}
Expand All @@ -49,6 +59,11 @@ services:
environment:
MYSQL_DATABASE: test
MYSQL_ROOT_PASSWORD: rootpassword
healthcheck:
test: [ "CMD", "mysqladmin", "ping", "-h", "localhost" ]
interval: 10s
timeout: 5s
retries: 5

sshproxy:
image: keboola/db-component-ssh-proxy:latest
Expand All @@ -57,14 +72,5 @@ services:
links:
- mysql

wait:
image: waisbrot/wait
depends_on:
- mysql
- mysql-ssl
environment:
- TARGETS=mysql:3306,mysql-ssl:3306
- TIMEOUT=200

volumes:
ssh-keys:

0 comments on commit ee98cae

Please sign in to comment.