Skip to content

Commit

Permalink
Added healthcheck for docker compose
Browse files Browse the repository at this point in the history
  • Loading branch information
aldwin7894 committed Oct 6, 2022
1 parent aee9f99 commit 35eae06
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ services:
- 5432:5432
volumes:
- dbdata:/var/lib/postgresql/data
healthcheck:
test: "pg_isready"
interval: 10s
timeout: 5s
retries: 5
redis:
container_name: aldwin7894-redis
image: redis:alpine
Expand All @@ -25,6 +30,11 @@ services:
volumes:
- redis:/data
- ./config/redis.conf:/usr/local/etc/redis/redis.conf
healthcheck:
test: redis-cli ping
interval: 10s
timeout: 5s
retries: 5
web:
build:
context: .
Expand Down Expand Up @@ -57,6 +67,12 @@ services:
- OCCSON_PASSPHRASE
volumes:
- ruby-gems:/gems
healthcheck:
test: curl -f http://web:3000/healthcheck
interval: 1m30s
timeout: 30s
retries: 5
start_period: 10s

volumes:
dbdata:
Expand Down

0 comments on commit 35eae06

Please sign in to comment.