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

Use docker healthcheck #168

Merged
merged 4 commits into from
Jan 3, 2022
Merged

Conversation

boekkooi-lengoo
Copy link
Contributor

Hello and Happy Holidays (or I hope they where),

This PR removes tests/wait-postgres-docker.sh in favor of using a docker healthcheck with pg-isready instead.

Thanks for reviewing this and have a great day!

Also see:

Use a docker healthcheck with pg-isready instead of a custom bash script. It's just one thing less to maintain.

Also see:
- https://www.postgresql.org/docs/9.4/app-pg-isready.html
- https://docs.docker.com/engine/reference/builder/#healthcheck
This fixes the following error message.
```
Fix `FATAL:  role "root" does not exist`
```

Also see:
- https://docs.docker.com/engine/reference/builder/#user
- https://github.com/docker-library/postgres/blob/3bb4804/14/bullseye/Dockerfile#L23
@cyrilgdn
Copy link
Owner

cyrilgdn commented Jan 3, 2022

@boekkooi-lengoo Thanks, I discovered Docker health checks only a couple of months ago and wanted to do it here 👍

@cyrilgdn
Copy link
Owner

cyrilgdn commented Jan 3, 2022

docker-compose is outdated on this ubuntu-latest container (and does not have the --wait option), I allowed myself to push on your PR to switch it to the new one packaged as a Docker plugin (so docker compose).

Copy link
Owner

@cyrilgdn cyrilgdn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 👍

@cyrilgdn cyrilgdn merged commit 37a092e into cyrilgdn:master Jan 3, 2022
@boekkooi-lengoo boekkooi-lengoo deleted the docker-heath branch January 4, 2022 08:20
SpencerBinXia pushed a commit to SpencerBinXia/terraform-provider-postgresql that referenced this pull request Feb 11, 2022
* Use docker healthcheck

Use a docker healthcheck with pg-isready instead of a custom bash script. It's just one thing less to maintain.

Also see:
- https://www.postgresql.org/docs/9.4/app-pg-isready.html
- https://docs.docker.com/engine/reference/builder/#healthcheck

* Set USER

This fixes the following error message.
```
Fix `FATAL:  role "root" does not exist`
```

Also see:
- https://docs.docker.com/engine/reference/builder/#user
- https://github.com/docker-library/postgres/blob/3bb4804/14/bullseye/Dockerfile#L23

* Use docker compose instead of docker-compose

* Update terraform SDK libs

Co-authored-by: Cyril Gaudin <cyril.gaudin@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants