Skip to content

Commit

Permalink
Add healthcheck container
Browse files Browse the repository at this point in the history
To make certain of runnning database containers.
  • Loading branch information
meganemura committed Apr 15, 2018
1 parent 86fb9bd commit 3dcf2df
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,33 @@
version: '2'
version: '2.3'
services:
postgresql:
image: postgres:9.5.12
environment:
POSTGRES_PASSWORD: ""
ports:
- "5432:5432"
healthcheck:
test: pg_isready -U postgres
start_period: 10s
interval: 10s
timeout: 30s
retries: 3
mysql:
image: mysql:5.7
environment:
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
ports:
- "3306:3306"
healthcheck:
test: mysqladmin -h 127.0.0.1 -uroot ping
start_period: 15s
interval: 10s
timeout: 30s
retries: 3
healthcheck:
image: busybox
depends_on:
postgresql:
condition: service_healthy
mysql:
condition: service_healthy

0 comments on commit 3dcf2df

Please sign in to comment.