diff options
| author | Fuwn <[email protected]> | 2026-01-19 04:01:13 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2026-01-19 04:01:13 -0800 |
| commit | 972211e50666efffc9a37e4735e2dcdb7d3b1082 (patch) | |
| tree | b3b655ecdf7cd4015ae6d399a865ee911fd14015 | |
| parent | fix: Remove superfluous WriteHeader call in template error handling (diff) | |
| download | kaze-972211e50666efffc9a37e4735e2dcdb7d3b1082.tar.xz kaze-972211e50666efffc9a37e4735e2dcdb7d3b1082.zip | |
feat: Simplify Docker to single data volume mount
| -rw-r--r-- | Dockerfile | 6 | ||||
| -rw-r--r-- | README.md | 11 | ||||
| -rw-r--r-- | config.example.yaml | 9 | ||||
| -rw-r--r-- | ideas.md | 5 |
4 files changed, 23 insertions, 8 deletions
@@ -41,13 +41,11 @@ USER kaze # Expose port EXPOSE 8080 -# Default config location -ENV KAZE_CONFIG=/app/config.yaml - # Health check HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \ CMD wget --no-verbose --tries=1 --spider http://localhost:8080/ || exit 1 # Run the application +# Config and database will be in /app/data volume mount ENTRYPOINT ["./kaze"] -CMD ["--config", "/app/config.yaml"] +CMD ["--config", "/app/data/config.yaml"] @@ -126,8 +126,15 @@ make build-all # Build image docker build -t kaze . -# Run -docker run -p 8080:8080 -v ./config.yaml:/app/config.yaml kaze +# Run with single data volume (recommended) +# Place config.yaml in your data directory before running +mkdir -p data +cp config.example.yaml data/config.yaml +# Edit data/config.yaml and set storage.path to "./data/kaze.db" +docker run -d -p 8080:8080 -v $(pwd)/data:/app/data kaze + +# Or run with separate mounts (legacy) +docker run -p 8080:8080 -v ./config.yaml:/app/config.yaml -v ./data:/app/data kaze ``` ## Command Line Options diff --git a/config.example.yaml b/config.example.yaml index aca9c6a..d5355da 100644 --- a/config.example.yaml +++ b/config.example.yaml @@ -1,5 +1,10 @@ # Kaze Status Page Configuration # Copy this file to config.yaml and customize for your needs +# +# Docker Usage: +# When running in Docker, place this file and the database in a single data directory: +# docker run -d -p 8080:8080 -v $(pwd)/data:/app/data ghcr.io/fuwn/kaze:latest +# The container expects the config at /app/data/config.yaml # Site metadata site: @@ -15,8 +20,8 @@ server: # Storage settings storage: - path: "./kaze.db" - history_days: 90 # How many days of history to retain (7, 30, or 90) + path: "./kaze.db" # For Docker single-volume: use "./data/kaze.db" to store in mounted volume + history_days: 90 # How many days of history to retain (7, 30, or 90) # Display settings display: @@ -40,6 +40,11 @@ - Response time graphs/charts - Uptime trends and analytics +### Performance Optimizations +- **Response buffering**: Render template to buffer first, then write atomically (prevents broken pipe errors) +- **Page caching**: Cache rendered status page for a few seconds to reduce database load +- **Reduce tick count**: Make tick count configurable per deployment or auto-adjust based on load + ### Notifications & Alerts - Webhook support for status changes - Email notifications |