Files
TTN-VEGAPULS-Air-exporter/docker-compose.yml
2026-01-04 11:32:33 +01:00

66 lines
1.4 KiB
YAML

version: '3.8'
services:
ttn-vegapuls-exporter:
image: python:3.11-slim
container_name: ttn-vegapuls-exporter
restart: unless-stopped
# Install dependencies and run exporter
entrypoint: |
sh -c "pip install --no-cache-dir paho-mqtt && python ttn-vegapulsair-exporter.py"
working_dir: /app
# Expose metrics port
ports:
- "9106:9106"
# Mount application files (read-only)
volumes:
- ./ttn-vegapulsair-exporter.py:/app/ttn-vegapulsair-exporter.py:ro
- ./config.py:/app/config.py:ro
# Environment variables
environment:
- PYTHONUNBUFFERED=1
# Health check
healthcheck:
test: ["CMD-SHELL", "python -c 'import urllib.request; urllib.request.urlopen(\"http://localhost:9106/health\")' || exit 1"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
# Resource limits
deploy:
resources:
limits:
memory: 256M
cpus: '0.05'
reservations:
memory: 64M
# Logging configuration
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
# Network configuration
networks:
- monitoring
# Security options
security_opt:
- no-new-privileges:true
# Run as non-root user
user: "1000:1000"
networks:
monitoring:
driver: bridge