Skip to content

Commit

Permalink
Merge pull request #315 from jolicode/HEALTHCHECK
Browse files Browse the repository at this point in the history
add some healthcheck
  • Loading branch information
pyrech authored Jul 23, 2024
2 parents e575c9d + 6752ade commit 7d95865
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,11 @@ services:
- "project-name=${PROJECT_NAME}"
- "traefik.http.routers.${PROJECT_NAME}-elasticsearch.rule=Host(`elasticsearch.${PROJECT_ROOT_DOMAIN}`)"
- "traefik.http.routers.${PROJECT_NAME}-elasticsearch.tls=true"
healthcheck:
test: "curl --fail http://localhost:9200/_cat/health || exit 1"
interval: 5s
timeout: 5s
retries: 5
profiles:
- default

Expand Down Expand Up @@ -404,6 +409,11 @@ services:
- "traefik.http.routers.${PROJECT_NAME}-rabbitmq.rule=Host(`rabbitmq.${PROJECT_ROOT_DOMAIN}`)"
- "traefik.http.routers.${PROJECT_NAME}-rabbitmq.tls=true"
- "traefik.http.services.rabbitmq.loadbalancer.server.port=15672"
healthcheck:
test: "rabbitmqctl eval '{ true, rabbit_app_booted_and_running } = { rabbit:is_booted(node()), rabbit_app_booted_and_running }, { [], no_alarms } = { rabbit:alarms(), no_alarms }, [] /= rabbit_networking:active_listeners(), rabbitmq_node_is_healthy.' || exit 1"
interval: 5s
timeout: 5s
retries: 5
profiles:
- default
```
Expand Down Expand Up @@ -443,8 +453,15 @@ volumes:
services:
redis:
image: redis:5
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 5
volumes:
- "redis-data:/data"
profiles:
- default
redis-insight:
image: redislabs/redisinsight
Expand Down Expand Up @@ -902,6 +919,11 @@ index 49a2661..1804a01 100644
+ image: mysql:8
+ environment:
+ - MYSQL_ALLOW_EMPTY_PASSWORD=1
+ healthcheck:
+ test: "mysqladmin ping -h localhost"
+ interval: 5s
+ timeout: 5s
+ retries: 10
volumes:
- - postgres-data:/var/lib/postgresql/data
+ - mysql-data:/var/lib/mysql
Expand Down
5 changes: 5 additions & 0 deletions infrastructure/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,10 @@ services:
- POSTGRES_PASSWORD=app
volumes:
- postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
profiles:
- default

0 comments on commit 7d95865

Please sign in to comment.