note-articles/static/scripts/anythingllm-setup.sh
koide c8d46ca842
All checks were successful
Deploy Docusaurus Site / deploy (push) Successful in 26s
Add: DGX Spark AnythingLLM記事 + ワンライナースクリプト
2026-02-20 05:14:16 +00:00

58 lines
1.6 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# AnythingLLM Docker Setup Script
# Usage: curl -sL https://docs.techswan.online/scripts/anythingllm-setup.sh | bash
set -e
echo "🚀 AnythingLLM セットアップ開始..."
# Docker確認
if ! command -v docker &> /dev/null; then
echo "❌ Dockerがインストールされていません"
exit 1
fi
# 既存コンテナチェック
if docker ps -a --format '{{.Names}}' | grep -q '^anythingllm$'; then
echo "⚠️ 既存のanythingllmコンテナを削除します..."
docker stop anythingllm 2>/dev/null || true
docker rm anythingllm 2>/dev/null || true
fi
# イメージ取得
echo "📦 Dockerイメージを取得中..."
docker pull mintplexlabs/anythingllm:latest
# コンテナ起動
echo "🐳 コンテナを起動中..."
docker run -d \
--name anythingllm \
-p 3001:3001 \
--cap-add SYS_ADMIN \
--add-host=host.docker.internal:host-gateway \
-v anythingllm_storage:/app/server/storage \
-e STORAGE_DIR=/app/server/storage \
--restart unless-stopped \
mintplexlabs/anythingllm:latest
# 起動待機
echo "⏳ 起動を待機中..."
sleep 5
# 確認
if docker ps --format '{{.Names}}' | grep -q '^anythingllm$'; then
echo ""
echo "✅ AnythingLLM セットアップ完了!"
echo ""
echo "📍 アクセスURL: http://$(hostname -I | awk '{print $1}'):3001"
echo ""
echo "💡 ヒント:"
echo " - 初回アクセス時にLLMプロバイダーを選択Ollama推奨"
echo " - Ollamaが同じマシンで動いていれば自動検出されます"
echo ""
else
echo "❌ 起動に失敗しました"
docker logs anythingllm
exit 1
fi