Sign inSign up

abcjava/java-waitfor-postgres

By abcjava

Updated over 8 years ago

A java docker file that waits with starting until a postgres db is available

Image
0

3.0K

abcjava/java-waitfor-postgres repository overview

docker-java-waitfor-postgres

A java docker file that waits with starting until a postgres db is available. To be used with docker-compose.

This fixes the problem with Play plus evolutions as described in this Play issue.
The docker file implements the solution from the docker-compose documentation.

It uses java 8 and Postgres client (v9.6). See the Dockerfile.

To use it add lines like the following to your compose.yml.

entrypoint: /wait-for-postgres.sh db01 bin/play-app-name
environment:
  - PGPASSWORD=postgres
  - PGUSER=postgres

The script wait-for-postgres.sh expects two arguments:

  • the name of the db host
  • the command to run when the db host is available. If you're using sbt-native to build a Play app as a docker image that will be bin/<play-app-name>.

Tag summary

Content type

Image

Digest

Size

219 MB

Last updated

over 8 years ago

docker pull abcjava/java-waitfor-postgres