Skip to content

Commit 4b5dc4e

Browse files
committed
feat: [#12] add healthcheck to mysql service
1 parent 343aa27 commit 4b5dc4e

File tree

5 files changed

+15
-6
lines changed

5 files changed

+15
-6
lines changed

application/compose.yaml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ services:
6363
networks:
6464
- backend_network
6565
ports:
66-
- "9090:9090" # This port should not be exposed to the internet
66+
- "9090:9090" # This port should not be exposed to the internet
6767
volumes:
6868
- ./storage/prometheus/etc:/etc/prometheus:Z
6969
logging:
@@ -85,11 +85,18 @@ services:
8585
networks:
8686
- backend_network
8787
ports:
88-
- "3306:3306" # Only for debugging, remove in production
88+
- "3306:3306" # Only for debugging, remove in production
8989
volumes:
9090
- mysql_data:/var/lib/mysql
9191
- ./storage/mysql/init:/docker-entrypoint-initdb.d:ro
92-
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
92+
command: >
93+
--character-set-server=utf8mb4
94+
--collation-server=utf8mb4_unicode_ci
95+
healthcheck:
96+
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-p${MYSQL_PASSWORD}"]
97+
interval: 10s
98+
timeout: 5s
99+
retries: 5
93100
logging:
94101
options:
95102
max-size: "10m"

application/docs/deployment.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ This document outlines the deployment process for the Torrust Tracker demo appli
55
## 1. Prerequisites
66

77
- Ensure you have SSH access to the production server.
8-
- The server should be provisioned and configured according to the [Production Setup Guide](./production-setup.md).
8+
- The server should be provisioned and configured according to the
9+
[Production Setup Guide](./production-setup.md).
910

1011
## 2. Deployment Steps
1112

application/docs/firewall-requirements.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,6 @@ The tracker uses four main ports, each serving a specific purpose:
109109
- `/api/v1/metrics` - Prometheus metrics
110110
- Used by Prometheus for monitoring and Grafana dashboards
111111

112-
### Application Service Mapping
113-
114112
### Torrust Tracker
115113

116114
- **UDP ports 6868, 6969**: BitTorrent announce endpoints

application/share/container/default/config/prometheus.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
global:
23
scrape_interval: 15s # How often to scrape metrics
34

project-words.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ ethernets
2929
findtime
3030
fullchain
3131
genisoimage
32+
healthcheck
3233
hetznercloud
3334
INFOHASH
3435
initdb
@@ -45,6 +46,7 @@ maxretry
4546
misprocess
4647
mkisofs
4748
mktemp
49+
mysqladmin
4850
netdev
4951
newgrp
5052
newtrackon

0 commit comments

Comments
 (0)