Skip to content

Commit

Permalink
feat(docker-compose): Add heathcheck for redis and pg
Browse files Browse the repository at this point in the history
  • Loading branch information
julienbourdeau committed Jan 20, 2025
1 parent 73fffbb commit 0ab1f5f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
name: lago_dev

volumes:
front_node_modules_dev:
front_dist_dev:
Expand Down
14 changes: 14 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ services:
image: postgres:14-alpine
container_name: lago-db
restart: unless-stopped
healthcheck:
test:
[
"CMD-SHELL",
"pg_isready -U ${POSTGRES_USER:-lago} -d ${POSTGRES_DB:-lago} -h localhost -p ${POSTGRES_PORT:-5432}",
]
interval: 10s
timeout: 5s
retries: 5
environment:
POSTGRES_DB: ${POSTGRES_DB:-lago}
POSTGRES_USER: ${POSTGRES_USER:-lago}
Expand All @@ -25,6 +34,11 @@ services:
container_name: lago-redis
restart: unless-stopped
command: --port ${REDIS_PORT:-6379}
healthcheck:
test: [ "CMD", "redis-cli", "ping" ]
interval: 10s
timeout: 5s
retries: 5
volumes:
- lago_redis_data:/data
ports:
Expand Down

0 comments on commit 0ab1f5f

Please sign in to comment.