Why Nerve for Docker
Docker containers fail silently. A restart policy hides crashes. An unhealthy container serves errors. Nerve sends an encrypted push to your phone so you know immediately — without polling a dashboard or waiting for an email digest.
Watch Docker events in real time
Stream container lifecycle events and alert on deaths.
docker events --filter event=die --format '{{.Actor.Attributes.name}} exited' \
| while read -r line; do echo "$line" | nerve send; done
Cron: check for unhealthy containers
A cron job that runs every 2 minutes and alerts on unhealthy or exited containers.
# /etc/cron.d/nerve-docker-check
*/2 * * * * root docker ps --filter "health=unhealthy" --format "unhealthy: {{.Names}}" \
| nerve send --severity critical 2>/dev/null || true
Docker Compose health check
Add a watcher service to your docker-compose.yml that monitors other containers.
services:
app:
image: my-app:latest
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/health"]
interval: 30s
retries: 3
nerve-watcher:
image: alpine:latest
depends_on:
- app
environment:
- NERVE_DSN=nerve://TOKEN:[email protected]
entrypoint: /bin/sh -c
command: |
apk add --no-cache curl docker-cli &&
while true; do
UNHEALTHY=$(docker ps --filter "health=unhealthy" --format "{{.Names}}")
if [ -n "$UNHEALTHY" ]; then
echo "unhealthy: $UNHEALTHY" | nerve send --severity critical
fi
sleep 120
done
After a container exits
Capture the last 20 lines of logs from a crashed container and send them as context.
CONTAINER="my-app"
docker wait "$CONTAINER" && \
docker logs --tail 20 "$CONTAINER" 2>&1 \
| nerve send --severity critical
Quick start
go install github.com/nerve-ink/nerve-cli/cmd/nerve@latest
export NERVE_DSN="nerve://TOKEN:[email protected]"
echo "container my-app exited with code 137" | nerve send
FAQ
How do I get Docker crash notifications on my phone?
Use docker events or a cron script that checks docker ps for unhealthy or exited containers, then pipe the output to nerve send.
Does Nerve work with Docker Compose?
Yes. Store the NERVE_DSN as an environment variable and add a health-check sidecar or a cron-based watcher that calls nerve send on failure.
Are Docker alerts encrypted?
Yes. All signal payloads are end-to-end encrypted. The Nerve relay sees only ciphertext.