Skip to content

Conversation

@fumoboy007
Copy link

@fumoboy007 fumoboy007 commented Aug 23, 2024

The Dockerfile currently does not have a HEALTHCHECK instruction. Users of the Docker image currently need to add it manually (e.g. via Docker Compose). Instead, the Dockerfile itself should include the instruction.

To determine whether the service is healthy, one can use the pg_isready program, which is already part of the image. The program “checks the connection status of a PostgreSQL database server”.

Most of the default HEALTHCHECK options seem reasonable:

--interval=30s
--timeout=30s
--start-interval=5s
--retries=3

I set --start-period=1s because the default of 0s is too quick for this program.

Users of the image can still override the HEALTHCHECK instruction if they want to customize the command or the options.

@fumoboy007 fumoboy007 force-pushed the patch-1 branch 2 times, most recently from dbaafe4 to 11d58e9 Compare August 23, 2024 14:28
The `Dockerfile` currently does not have a `HEALTHCHECK` instruction. Users of the Docker image currently need to add it manually (e.g. via Docker Compose). Instead, the `Dockerfile` itself should include the instruction.

To determine whether the service is healthy, one can use the [`pg_isready`](https://www.postgresql.org/docs/current/app-pg-isready.html) program, which is already part of the image. The program “checks the connection status of a PostgreSQL database server”.

Most of the default `HEALTHCHECK` [options](https://docs.docker.com/reference/dockerfile/#healthcheck) seem reasonable:
```
--interval=30s
--timeout=30s
--start-interval=5s
--retries=3
```

I set `--start-period=1s` because the default of `0s` is too quick for this program.

Users of the image can still override the `HEALTHCHECK` instruction if they want to customize the command or the options.
@tianon tianon closed this Aug 23, 2024
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