Files
exAichatbot_agent/server-dev
2026-07-28 09:40:42 +09:00
..

exdev 서버 배포 — exAichatbot Agent 2.0

chatbot.exdev.co.kr Mac Studio 서버에 Agent 2.0 스택(RAG + WAS + Skill + chatbotApp)을 배포합니다.

GitHub upstream (submodule)

4개 서비스 소스는 GitHub KoreaExpressWayCorp 저장소를 git submodule로 연결합니다.

monorepo 경로 GitHub 브랜치
chatbotApp-chatbot2.0-agent https://github.com/KoreaExpressWayCorp/chatbotApp.git chatbot2.0-agent
chatbotApi-chatbot2.0-agent https://github.com/KoreaExpressWayCorp/chatbotApi.git chatbot2.0-agent
exAiChatBot-chatbot2.0-agent https://github.com/KoreaExpressWayCorp/exAiChatBot.git chatbot2.0-agent
kakaoChatbotSkill-chatbot2.0-agent https://github.com/KoreaExpressWayCorp/kakaoChatbotSkill.git chatbot2.0-agent

최초 clone:

git clone --recurse-submodules ssh://aidev@github.exdev.co.kr:2222/aidev/exAichatbot_agent.git

GitHub 최신 반영:

./git_fetch_all.sh              # GitHub → 로컬 submodule fast-forward
./git_fetch_all.sh --dry-run    # 변경 예상만 확인
./git_fetch_all.sh --init       # submodule 최초 clone 포함

RAG Docker compose(docker-compose.server.yml)는 submodule 밖 server-dev/docker-compose.rag.server.yml 에 두고, 기동 시 exAiChatBot-chatbot2.0-agent/로 복사합니다.

디렉터리

경로 (서버) 용도
/Users/aidev/dev/exAichatbot_agent Git work tree (배포 소스)
/Volumes/ADATA/git/exAichatbot_agent.git Gitea bare repo
/Volumes/ADATA/git/deploy-exAichatbot_agent.sh push → 배포 스크립트

1회 설정 (서버)

ssh aidev@chatbot.exdev.co.kr
bash /Users/aidev/dev/exAichatbot_agent/server-dev/setup-gitea.sh

Gitea(https://github.exdev.co.kr)에서 exAichatbot_agent 저장소 생성 (Initialize unchecked).

로컬 Mac → Gitea push → 서버 배포

개발 Mac에서 한 번에 GitHub 최신 반영 · Gitea push · 서버 빌드·배포:

./start-all-server.sh
# = 로컬 빌드 → Gitea(exdev) push → 원격 배포 (공식 GitHub push 없음)

./git_fetch_all.sh
# = 확인 후 공식 GitHub(KoreaExpressWayCorp) 반영 전용
옵션 설명
--local 예전처럼 local-dev/start-all.sh 로컬 개발 모드
--no-push Gitea push·원격 배포 생략
--no-pull GitHub submodule fetch 생략
--no-build Docker/Next 빌드 생략 (서버에서만 해당)

수동 push만:

./server-dev/push-to-gitea.sh
./server-dev/push-to-gitea.sh --dry-run

main push 시 자동: post-receive → deploy-exAichatbot_agent.sh → Gitea checkout → start-all-server.sh --no-pull --no-push
(공식 GitHub git_fetch_all 은 deploy 경로에서 호출하지 않음)

서버에서 GitHub clone 이 안 되면 로컬 ./start-all-server.sh 가 submodule rsync + chatbotApp 로컬 빌드 후 배포합니다.

배포 로그: /Volumes/ADATA/logs/deploy/exAichatbot_agent.log

로컬 → Gitea push (수동)

cd exChatbot_agent

# Gitea (이 서버는 git@ 가 아닌 aidev@ 사용)
git remote add origin ssh://aidev@github.exdev.co.kr:2222/aidev/exAichatbot_agent.git
git push -u origin main

# 잘못된 예 (Permission denied):
# git@github.exdev.co.kr:aidev/exAichatbot_agent.git

수동 기동 / 중지 (서버)

cd /Users/aidev/dev/exAichatbot_agent

./server-dev/stop-all-server.sh
./server-dev/start-all-server.sh          # Gitea checkout → GitHub submodule → 빌드 → 기동
./server-dev/start-all-server.sh --no-build
./server-dev/start-all-server.sh --no-pull   # git 동기화 생략
./server-dev/start-all-server.sh --no-push   # Gitea push 생략 (서버 전용)

스택 구성

서비스 포트 URL
HTTPS UI (Caddy) 443 https://chatbot.exdev.co.kr/chatbot/app/
chatbotApp nginx 8092 내부
kakaoChatbotSkill 8083 /web/ask, /kakao/skill (카카오 웹훅)
chatbotApi WAS 8086 /api
RAG API 28012 /agent/chat
Vector Admin 28013 /chatbot/admin
Qdrant 6333 REST
호스트 AI 16000~16002 MLX LLM/Embed/Rerank

Qdrant 데이터

  • 최초 기동 시 vector_count=0 이면 레거시 exAIChatbot2.0/exAiChatBot-chatbot2.0/qdrant_data 를 자동 복사
  • 이후 qdrant_data/ 볼륨 영속 유지 (git 제외)

환경변수

cp server-dev/env.exdev-server.template exAiChatBot-chatbot2.0-agent/.env

레거시 스택

start-all-server.sh는 포트 충돌 방지를 위해 exAIChatbot2.0/remote-stop-chatbot.sh 로 레거시 스택을 중지합니다.
유지하려면 --skip-legacy-stop 옵션을 사용하세요.