Created
November 13, 2023 23:05
-
-
Save namp10010/7a02879d286f9f82db9d70cf92afa52a to your computer and use it in GitHub Desktop.
postgres docker-compose with init scripts and health check.
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
postgres_db: | |
image: postgres | |
deploy: | |
resources: | |
limits: | |
memory: 125M | |
environment: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: password | |
healthcheck: | |
test: [ "CMD-SHELL", "pg_isready -d postgres -U postgres" ] | |
interval: 5s | |
timeout: 5s | |
retries: 5 | |
volumes: | |
- ./test/db/postgresql/init/:/docker-entrypoint-initdb.d/ | |
- ./.volumes/postgres:/var/lib/postgresql/data |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment