docker-library / docker-library/postgres
Add a HEALTHCHECK to the images
Nessuno ha ancora preso questa issue.
- Lingua principale
- Shell
- Stelle
- 2.5k
- Fork
- 1.2k
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
When helping people on StackOverflow, I often see people having problems with Docker Compose and applications that try to connect to the database immediately on startup. When using a simple docker compose 'depends_on' directive, compose only waits for the database to be started before starting the application. The application then fails because the database isn't ready to accept connections yet.
The solution is to add a healthcheck to the database container in docker compose and have the application wait for the database to enter a healthy state.
It would be nice if the healthcheck was included in the Postgres image by default. A simple HEALTHCHECK ["pg_isready"] should be enough.
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia individuando le definizioni delle immagini Docker per le immagini Postgres e verificando come vengono create le relative varianti. Aggiungi in modo coerente l’healthcheck richiesto, quindi verifica che Docker Compose possa attendere che il database segnali uno stato integro prima di avviare l’applicazione.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- docker, docker-compose, postgres
- Ambito
- databases, devops, infrastructure
- Tipo di issue
- Funzionalità
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Tranquilla
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 52/100