[Unit]
Description=Saltybot Social-Bot Stack (speech + LLM + TTS + face recognition)
Documentation=https://gitea.vayrette.com/seb/saltylab-firmware
After=docker.service network-online.target sound.target
Requires=docker.service
PartOf=saltybot.target

[Service]
Type=simple
Restart=on-failure
RestartSec=10s
TimeoutStartSec=120s
TimeoutStopSec=30s

User=root
WorkingDirectory=/opt/saltybot/jetson

# Pull latest image before start (optional — comment out for air-gapped deploy)
ExecStartPre=-/usr/bin/docker compose -f docker-compose.yml pull saltybot-social

# Start only the social service (not the entire stack)
ExecStart=/usr/bin/docker compose -f docker-compose.yml up --no-recreate saltybot-social

ExecStop=/usr/bin/docker compose -f docker-compose.yml stop saltybot-social

# Logging
StandardOutput=journal
StandardError=journal
SyslogIdentifier=saltybot-social

[Install]
WantedBy=saltybot.target multi-user.target
