73 lines
2.3 KiB
YAML
73 lines
2.3 KiB
YAML
---
|
|
services:
|
|
# Fix permissions for wakeword_data and configuration volume
|
|
fix-permissions:
|
|
image: "ghcr.io/ohf-voice/linux-voice-assistant:${LVA_VERSION:-latest}"
|
|
entrypoint: []
|
|
command: "chown -R ${LVA_USER_ID:-1000}:${LVA_USER_GROUP:-1000} /app/local /app/configuration /app/wakewords/custom /app/sounds/custom"
|
|
environment:
|
|
# Pulseaudio
|
|
- XDG_RUNTIME_DIR=${LVA_XDG_RUNTIME_DIR:-/run/user/1000}
|
|
- PULSE_SERVER=${LVA_PULSE_SERVER:-/run/user/1000/pulse/native}
|
|
- PULSE_COOKIE=${LVA_PULSE_COOKIE:-/run/user/1000/pulse/cookie}
|
|
env_file: ${ENV_FILE:-.env}
|
|
group_add:
|
|
- audio
|
|
volumes:
|
|
# Wakeword data and configuration
|
|
- wakeword_data:/app/local
|
|
- wakeword_custom:/app/wakewords/custom
|
|
- configuration:/app/configuration
|
|
- sounds_custom:/app/sounds/custom
|
|
restart: "no"
|
|
|
|
# Linux Voice Assistant
|
|
linux-voice-assistant:
|
|
container_name: linux-voice-assistant
|
|
image: "ghcr.io/ohf-voice/linux-voice-assistant:${LVA_VERSION:-latest}"
|
|
restart: unless-stopped
|
|
network_mode: "host"
|
|
user: "${LVA_USER_ID:-1000}:${LVA_USER_GROUP:-1000}"
|
|
environment:
|
|
# Pulseaudio
|
|
- XDG_RUNTIME_DIR=${LVA_XDG_RUNTIME_DIR:-/run/user/1000}
|
|
- PULSE_SERVER=${LVA_PULSE_SERVER:-/run/user/1000/pulse/native}
|
|
- PULSE_COOKIE=${LVA_PULSE_COOKIE:-/run/user/1000/pulse/cookie}
|
|
env_file: ${ENV_FILE:-.env}
|
|
group_add:
|
|
- audio
|
|
# Priority for audio process
|
|
cap_add:
|
|
- SYS_NICE
|
|
volumes:
|
|
# Wakeword data and configuration
|
|
- wakeword_data:/app/local
|
|
- wakeword_custom:/app/wakewords/custom
|
|
- configuration:/app/configuration
|
|
- sounds_custom:/app/sounds/custom
|
|
# Time and zone
|
|
- /etc/localtime:/etc/localtime:ro
|
|
- /etc/timezone:/etc/timezone:ro
|
|
# Pulseaudio
|
|
# /run/user/1000:/run/user/1000
|
|
- ${LVA_XDG_RUNTIME_DIR:-/run/user/1000}:${LVA_XDG_RUNTIME_DIR:-/run/user/1000}
|
|
depends_on:
|
|
- fix-permissions
|
|
# Health check for process
|
|
healthcheck:
|
|
test: ["CMD", "pgrep", "-f", "linux_voice_assistant"]
|
|
interval: 30s
|
|
timeout: 5s
|
|
retries: 3
|
|
start_period: 90s
|
|
#command:
|
|
# - --additional-parameters-here
|
|
# - --but-use-env-if-possible
|
|
|
|
|
|
volumes:
|
|
wakeword_data:
|
|
wakeword_custom:
|
|
configuration:
|
|
sounds_custom:
|