refactor: update Docker setup and remove deprecated monitoring components

- Replace curl with wget in healthcheck commands for better reliability.
- Remove server_monitor service and related configurations from docker-compose.
- Update Dockerfile to use a multi-stage build for optimized image size.
- Delete obsolete Dockerfile.optimized and related monitoring scripts.
- Clean up Makefile by removing commands related to the server_monitor service.
- Update README to reflect changes in monitoring services and commands.
This commit is contained in:
2025-09-16 17:49:42 +03:00
parent 8673cb4f55
commit 30830c5bd9
26 changed files with 43 additions and 4668 deletions

View File

@@ -45,43 +45,17 @@ services:
depends_on:
- prometheus
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:3000/api/health || exit 1"]
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000/api/health"]
interval: 30s
timeout: 10s
retries: 3
# Server Monitoring Service
server_monitor:
build: .
container_name: bots_server_monitor
restart: unless-stopped
ports:
- "9091:9091"
environment:
- TELEGRAM_BOT_TOKEN=${TELEGRAM_MONITORING_BOT_TOKEN}
- GROUP_FOR_LOGS=${GROUP_MONITORING_FOR_LOGS}
- IMPORTANT_LOGS=${IMPORTANT_MONITORING_LOGS}
- THRESHOLD=${THRESHOLD:-80.0}
- RECOVERY_THRESHOLD=${RECOVERY_THRESHOLD:-75.0}
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /var/run:/host/var/run:ro
networks:
- bots_network
depends_on:
- prometheus
healthcheck:
test: ["CMD-SHELL", "ps aux | grep python | grep server_monitor || exit 1"]
interval: 60s
timeout: 10s
retries: 3
# Telegram Helper Bot
telegram-bot:
build:
context: ./bots/telegram-helper-bot
dockerfile: Dockerfile.bot
dockerfile: Dockerfile
container_name: bots_telegram_bot
restart: unless-stopped
env_file:
@@ -122,7 +96,7 @@ services:
depends_on:
- prometheus
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8080/health"]
interval: 30s
timeout: 10s
retries: 3
@@ -175,7 +149,7 @@ services:
depends_on:
- prometheus
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8081/health"]
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8081/health"]
interval: 30s
timeout: 10s
retries: 3