Public | Automated Build

Last pushed: 6 days ago
Short Description
A java docker file that waits with starting until a postgres db is available
Full Description

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>.
Docker Pull Command
Owner
abcjava