feat: Added homeassistant plugin
This commit is contained in:
80
homeassistant/docker-compose.example.yml
Normal file
80
homeassistant/docker-compose.example.yml
Normal file
@@ -0,0 +1,80 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
homeassistant:
|
||||
container_name: homeassistant
|
||||
image: ghcr.io/home-assistant/home-assistant:stable
|
||||
volumes:
|
||||
# Main Home Assistant configuration
|
||||
- ./homeassistant-config:/config
|
||||
|
||||
# Mount the Hyprmonitors integration directly
|
||||
- ./custom_components/hyprmonitors:/config/custom_components/hyprmonitors:ro
|
||||
|
||||
# Optional: Mount examples for reference
|
||||
- ./examples.yaml:/config/hyprmonitors-examples.yaml:ro
|
||||
|
||||
# System access (needed for some integrations)
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
|
||||
restart: unless-stopped
|
||||
privileged: true
|
||||
network_mode: host
|
||||
|
||||
environment:
|
||||
# Set timezone
|
||||
- TZ=America/New_York # Change to your timezone
|
||||
|
||||
# Health check
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:8123/api/"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 30s
|
||||
|
||||
# Optional: Include the Hyprmonitors server in the same compose file
|
||||
hyprmonitors:
|
||||
container_name: hyprmonitors-server
|
||||
build:
|
||||
context: ../
|
||||
dockerfile: Dockerfile
|
||||
ports:
|
||||
- "3000:3000"
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- HYPRMONITORS_HOST=0.0.0.0
|
||||
- HYPRMONITORS_PORT=3000
|
||||
- RUST_LOG=info
|
||||
|
||||
# Mount Hyprland socket (adjust path as needed)
|
||||
volumes:
|
||||
- /tmp/hypr:/tmp/hypr:ro
|
||||
- $XDG_RUNTIME_DIR/hypr:/run/user/1000/hypr:ro
|
||||
|
||||
# Network access to Hyprland
|
||||
network_mode: host
|
||||
|
||||
# Ensure Hyprland environment is available
|
||||
environment:
|
||||
- XDG_RUNTIME_DIR=/run/user/1000
|
||||
- HYPRLAND_INSTANCE_SIGNATURE=${HYPRLAND_INSTANCE_SIGNATURE}
|
||||
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:3000/health"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 10s
|
||||
|
||||
# Optional: Create a custom network if not using host networking
|
||||
networks:
|
||||
homelab:
|
||||
driver: bridge
|
||||
ipam:
|
||||
config:
|
||||
- subnet: 172.20.0.0/16
|
||||
|
||||
volumes:
|
||||
homeassistant-config:
|
||||
driver: local
|
||||
Reference in New Issue
Block a user