https://github.com/bwibo/wait-for-psql-docker
Docker image to wait for PostgreSQL to become available
https://github.com/bwibo/wait-for-psql-docker
availability check database docker postgres postgresql wait-for-it
Last synced: 10 months ago
JSON representation
Docker image to wait for PostgreSQL to become available
- Host: GitHub
- URL: https://github.com/bwibo/wait-for-psql-docker
- Owner: BWibo
- License: apache-2.0
- Created: 2022-05-05T13:51:04.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-08-22T11:06:00.000Z (over 3 years ago)
- Last Synced: 2025-02-15T23:25:39.773Z (12 months ago)
- Topics: availability, check, database, docker, postgres, postgresql, wait-for-it
- Language: Shell
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Wait for `psql`
`wait-for-psql` is a simple script packed in a `Dockerfile` to wait for a
postgres database to become available. For instance, this is handy when
automatically testing a database schema, that takes some time to setup.
The Docker image is available at `bwibo/wait-for-psql` from
[DockerHub](https://hub.docker.com/repository/docker/bwibo/wait-for-psql/tags).
```text
Usage:
docker run --rm -t bwibo/wait-for-psql \
TIMEOUT HOST PORT DBNAME USERNAME PASSWORD [COMMAND] [ARGUMENTS...]
TIMEOUT Timeout in seconds
HOST Host or IP of the postgres server
PORT Postgres server port
DBNAME Postgres database name
USERNAME Postgres db user
PASSWORD Postgres db password
COMMAND ARGS Execute command with args after the test finishes
Exit codes: 0 = Postgres available, 1 = timeout.
```