New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use healthcheck to make sure DB container starts first #3

Merged
merged 1 commit into from Mar 14, 2017
Jump to file or symbol
Failed to load files and symbols.
+10 −2
Diff settings

Always

Just for now

View
@@ -1,4 +1,4 @@
version: '2'
version: '2.1'
services:
db:
container_name: twpg
@@ -8,15 +8,23 @@ services:
restart: always
ports:
- "5432:5432"
healthcheck:
test: "pg_isready -h localhost -p 5432 -q -U postgres"
interval: 10s
timeout: 5s
retries: 5
web:
container_name: twtc
build:
context: .
dockerfile: Dockerfile.tomcat
restart: always
depends_on:
- db
db:
condition: service_healthy
links:
- db
ports:
- "80:8080"