opencode/compose.yaml aktualisiert

This commit is contained in:
thomas committed 2026-12-05 21:31:16 +00:00
1 parent 608f75dc1c
commit 7229af0899
1 file changed
+22
+22
View File
@@ -12,6 +12,28 @@ services:
command:
- |
command -v git >/dev/null 2>&1 || /sbin/apk add --no-cache git curl ca-certificates
# Background Git sync loop for /root/.config/opencode
(
while true; do
sleep 60
if [ -d /root/.config/opencode/.git ]; then
cd /root/.config/opencode || continue
git fetch origin main -q 2>/dev/null || continue
LOCAL=$$(git rev-parse HEAD 2>/dev/null)
REMOTE=$$(git rev-parse origin/main 2>/dev/null)
if [ -n "$$REMOTE" ] && [ "$$LOCAL" != "$$REMOTE" ]; then
CHANGED=$$(git diff --name-only "$$LOCAL" "$$REMOTE")
git pull --ff-only origin main -q
# Restart container only if opencode.jsonc changed
if echo "$$CHANGED" | grep -q "opencode.jsonc"; then
kill 1
fi
fi
fi
done
) &
exec opencode web --port 4096 --hostname 0.0.0.0 --print-logs --log-level "$${LOG_LEVEL}"
environment:
- HOME=/root