-
Notifications
You must be signed in to change notification settings - Fork 18
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
chore: add docker-compose healthcheck for postgres #437
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,15 @@ version: '2.2' | |
services: | ||
postgres-db: | ||
image: postgres:latest | ||
container_name: postgres-db | ||
ports: | ||
- 5432:5432 | ||
environment: | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: postgres | ||
healthcheck: | ||
test: ['CMD', 'pg_isready', "-q", "-d", "postgres", "-U", "postgres"] | ||
interval: 5s | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. doesn't matter much but maybe this should be shorter, like 2s (and more retries)? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, could be shorter. Just left it the same as earlier. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looking at this more closely, the healthcheck will keep being tested at this interval while the container is running. So when originally setting this up (for Kalix) the 5s interval was a balance, for getting to healthy but also not checking too frequently during running. Shorter is probably fine though. There's a new start-interval setting coming, so that the regular healthcheck interval can be longer, and the interval during startup can be much shorter. Maybe we use that, once it's released and available. Scheduled for docker engine version 25.0. |
||
retries: 5 | ||
start_period: 5s | ||
timeout: 5s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and just to repeat, the fix is: