first commit

This commit is contained in:
Xavier Rodriguez
2025-12-09 12:45:15 +01:00
commit 7fc616b5c3
44 changed files with 6981 additions and 0 deletions
+79
View File
@@ -0,0 +1,79 @@
# Docker Compose para Cisco MAC Monitor
# ====================================
version: '3.8'
services:
cisco-mac-monitor:
build:
context: .
dockerfile: Dockerfile
image: cisco-mac-monitor:latest
container_name: cisco-mac-monitor
# Reiniciar automáticamente
restart: unless-stopped
# Variables de entorno
environment:
- CONFIG_FILE=/config/config.yaml
- LOG_LEVEL=INFO
- MONITORING_INTERVAL=5
- TZ=Europe/Madrid
# Volúmenes para persistencia
volumes:
# Configuración (REQUERIDO)
- ./config:/config:ro
# Logs (opcional)
- ./logs:/logs
# Datos de salida (opcional)
- ./data:/data
# Zona horaria del host
- /etc/localtime:/etc/localtime:ro
# Red del host para acceso a dispositivos locales
network_mode: host
# Límites de recursos
deploy:
resources:
limits:
cpus: '0.5'
memory: 256M
reservations:
cpus: '0.1'
memory: 64M
# Healthcheck
healthcheck:
test: ["CMD", "python3", "/app/cisco_mac_monitor.py", "--config", "/config/config.yaml", "--single-run"]
interval: 5m
timeout: 30s
retries: 3
start_period: 30s
# Logging del contenedor
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
# Redes (opcional si no usas host)
networks:
cisco-network:
driver: bridge
ipam:
config:
- subnet: 172.20.0.0/16
# Volúmenes con nombre (alternativo)
volumes:
cisco-logs:
driver: local
cisco-data:
driver: local