Files
tyto/docker-compose.yml
vikingowl 62b2dad19d feat: add Docker Compose and installation scripts
Docker Compose:
- docker-compose.yml: Base configuration for development
  - Frontend (nginx) on port 3000
  - Backend (Go) on ports 8080 (HTTP) and 9849 (gRPC)
  - Volume mounts for /proc, /sys (system metrics)
  - Named volume for data persistence
  - Health check for backend
- docker-compose.prod.yml: Production overrides
  - Resource limits (CPU/memory)
  - Log rotation configuration

Installation Script (scripts/install.sh):
- One-line installation support via curl/wget
- Cross-platform: Linux (amd64, arm64, arm)
- Creates system user and directories
- Downloads and installs binary from GitHub releases
- Generates YAML configuration file
- Creates and enables systemd service
- Security hardening with systemd sandboxing
- Resource limits for production use

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-28 08:55:57 +01:00

68 lines
1.5 KiB
YAML

# Tyto System Monitor - Docker Compose Configuration
#
# Usage:
# Development: docker compose up --build
# Production: docker compose -f docker-compose.yml -f docker-compose.prod.yml up -d
#
# Ports:
# - 3000: Frontend UI (development with hot reload)
# - 8080: Backend API / SSE
# - 9849: gRPC (multi-device server mode)
services:
# Frontend SvelteKit application
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
ports:
- "3000:80"
depends_on:
- backend
environment:
- VITE_API_URL=http://backend:8080
restart: unless-stopped
networks:
- tyto-network
# Backend Go server
backend:
build:
context: ./backend
dockerfile: Dockerfile
ports:
- "8080:8080"
- "9849:9849"
environment:
# Operating mode: standalone, server, or agent
- TYTO_MODE=standalone
# Refresh rate in seconds
- TYTO_REFRESH_RATE=5
# Database configuration (for server mode)
- TYTO_DB_TYPE=sqlite
- TYTO_DB_PATH=/data/tyto.db
# Logging
- TYTO_LOG_LEVEL=info
volumes:
- tyto-data:/data
- /proc:/host/proc:ro
- /sys:/host/sys:ro
privileged: true
restart: unless-stopped
networks:
- tyto-network
healthcheck:
test: ["CMD", "wget", "-q", "--spider", "http://localhost:8080/api/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
volumes:
tyto-data:
driver: local
networks:
tyto-network:
driver: bridge