Last active
November 7, 2022 22:26
-
-
Save beci/e968d16363e71c77a1aa0495cdde5161 to your computer and use it in GitHub Desktop.
A sample (from featmap) docker service definition with healthcheck
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# link https://gist.githubusercontent.com/beci/e968d16363e71c77a1aa0495cdde5161/raw/c6a39779c8a951283f38af0d390484f6bb2ee837/docker-compose-postgres-with-healt-check.txt | |
# | |
postgres: | |
image: postgres:11-alpine | |
restart: always | |
volumes: | |
- ${PWD}/data:/var/lib/postgresql/data | |
environment: | |
POSTGRES_DB: ${FEATMAP_DB} | |
POSTGRES_USER: ${FEATMAP_DB_USER} | |
POSTGRES_PASSWORD: ${FEATMAP_DB_PASSWORD} | |
healthcheck: | |
test: [ "CMD-SHELL", "pg_isready -U ${FEATMAP_DB_USER}" ] | |
interval: 10s | |
timeout: 5s | |
retries: 5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
And on the depending service: