BWibo / wait-for-psql-docker

Docker image to wait for PostgreSQL to become available

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

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.

About

Docker image to wait for PostgreSQL to become available

License:Apache License 2.0


Languages

Language:Shell 90.7%Language:Dockerfile 9.3%