Skip to content

Commit

Permalink
Merge pull request #207 from go-gormigrate/cleanup-docker-compose
Browse files Browse the repository at this point in the history
integration-test: replace wait containers with native healthchecks
  • Loading branch information
avakarev committed Jun 2, 2023
2 parents 7c7d987 + 0592fdb commit 217db5c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ tasks:
deps: [docker:compose:down]
cmds:
- task: docker:compose
vars: {CMD: up --detach --no-deps --remove-orphans --force-recreate}
vars: {CMD: up --detach --no-deps --remove-orphans --force-recreate --wait}

docker:compose:logs:
desc: Start streaming docker compose logs
Expand Down
27 changes: 15 additions & 12 deletions integration-test/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ services:
POSTGRES_DB: gormigrate
POSTGRES_USER: gormigrate
POSTGRES_PASSWORD: gormigrate

postgres-wait:
image: eficode/wait-for
command: postgres:5432
healthcheck:
test: pg_isready --username="$${POSTGRES_USER}" --dbname="$${POSTGRES_DB}"
interval: 2s
timeout: 3s
retries: 10

mysql:
image: mariadb:10
Expand All @@ -23,10 +24,11 @@ services:
MYSQL_ROOT_PASSWORD: gormigrate
MYSQL_USER: gormigrate
MYSQL_PASSWORD: gormigrate

mysql-wait:
image: eficode/wait-for
command: mysql:3306
healthcheck:
test: mysqladmin ping --user="$${MYSQL_USER}" --password="$${MYSQL_PASSWORD}"
interval: 2s
timeout: 3s
retries: 10

sqlserver:
image: mcr.microsoft.com/mssql/server:2022-latest
Expand All @@ -35,7 +37,8 @@ services:
environment:
ACCEPT_EULA: Y
MSSQL_SA_PASSWORD: LoremIpsum86

sqlserver-wait:
image: eficode/wait-for
command: sqlserver:1433
healthcheck:
test: /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P "$${MSSQL_SA_PASSWORD}" -Q "SELECT 1" -b -o /dev/null
interval: 5s
timeout: 3s
retries: 20

0 comments on commit 217db5c

Please sign in to comment.