Skip to content

Commit

Permalink
feat: Add healthchecks for redis, memcached and postgres (#975)
Browse files Browse the repository at this point in the history
Ref: #950
  • Loading branch information
williamdes authored Jun 2, 2021
1 parent 97e4e37 commit f4c3096
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,22 @@ services:
memcached:
<<: *restart_policy
image: "memcached:1.5-alpine"
healthcheck:
# From: https://stackoverflow.com/a/31877626/5155484
test: echo stats | nc 127.0.0.1 11211
interval: 2s
timeout: 3s
retries: 30
start_period: 3s
redis:
<<: *restart_policy
image: "redis:5.0-alpine"
healthcheck:
test: redis-cli ping
interval: 2s
timeout: 3s
retries: 30
start_period: 3s
volumes:
- "sentry-redis:/data"
ulimits:
Expand All @@ -71,6 +84,13 @@ services:
postgres:
<<: *restart_policy
image: "postgres:9.6"
healthcheck:
# Using default user "postgres" from sentry/sentry.conf.example.py or value of POSTGRES_USER if provided
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres}"]
interval: 2s
timeout: 3s
retries: 30
start_period: 10s
command: ["postgres", "-c", "wal_level=logical", "-c", "max_replication_slots=1", "-c", "max_wal_senders=1"]
environment:
POSTGRES_HOST_AUTH_METHOD: "trust"
Expand Down

0 comments on commit f4c3096

Please sign in to comment.