-
Notifications
You must be signed in to change notification settings - Fork 0
chore: MCP 서버 전역설치 및 심볼릭 링크 생성, 빌드타임 확인 명령어 추가 #398
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,7 @@ FROM gradle:8.10.2-jdk17 AS builder | |
| # 작업 디렉토리 설정 | ||
| WORKDIR /build | ||
|
|
||
| # 소스 복사 (모듈 전체가 아닌 현재 모듈만 복사) | ||
| # 소스 복사 | ||
| COPY gradlew settings.gradle build.gradle ./ | ||
| COPY gradle gradle/ | ||
| COPY cs25-service cs25-service/ | ||
|
|
@@ -12,6 +12,8 @@ COPY cs25-common cs25-common/ | |
|
|
||
| # 테스트 생략하여 빌드 안정화 | ||
| RUN ./gradlew :cs25-service:bootJar --stacktrace --no-daemon | ||
|
|
||
|
|
||
| FROM eclipse-temurin:17-jre-jammy | ||
|
|
||
| # 메타 정보 | ||
|
|
@@ -20,12 +22,23 @@ LABEL type="application" module="cs25-service" | |
| # 작업 디렉토리 | ||
| WORKDIR /apps | ||
|
|
||
| # Node.js + npm 설치 후, MCP 서버 전역 설치 | ||
| # Node.js + npm 설치 후, MCP 서버 전역 설치 + 심볼릭 링크 생성 + 빌드 타임 확인 | ||
| RUN apt-get update \ | ||
| && apt-get install -y --no-install-recommends curl ca-certificates gnupg bash \ | ||
| && curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \ | ||
| && apt-get install -y --no-install-recommends nodejs \ | ||
| && npm install -g @modelcontextprotocol/server-brave-search \ | ||
| && ln -sf "$(npm bin -g)/server-brave-search" /usr/local/bin/server-brave-search \ | ||
| \ | ||
| # ===== 실행 가능 여부 확인 ===== | ||
| && echo "=== npm bin 경로 확인 ===" \ | ||
| && npm bin -g \ | ||
| && echo "=== server-brave-search 바이너리 확인 ===" \ | ||
| && ls -l "$(npm bin -g)/server-brave-search" \ | ||
| && ls -l /usr/local/bin/server-brave-search \ | ||
| && echo "=== server-brave-search --help 실행 ===" \ | ||
| && /usr/local/bin/server-brave-search --help || (echo "[ERROR] server-brave-search 실행 실패" && exit 1) \ | ||
| \ | ||
|
Comment on lines
+31
to
+41
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion 심볼릭 링크 자기참조(무한 루프) 가능성 및 검증 로직 보강 제안.
적용 제안: - && ln -sf "$(npm bin -g)/server-brave-search" /usr/local/bin/server-brave-search \
- \
- # ===== 실행 가능 여부 확인 =====
- && echo "=== npm bin 경로 확인 ===" \
- && npm bin -g \
- && echo "=== server-brave-search 바이너리 확인 ===" \
- && ls -l "$(npm bin -g)/server-brave-search" \
- && ls -l /usr/local/bin/server-brave-search \
- && echo "=== server-brave-search --help 실행 ===" \
- && /usr/local/bin/server-brave-search --help || (echo "[ERROR] server-brave-search 실행 실패" && exit 1) \
+ && BIN_DIR="$(npm bin -g)" \
+ && TARGET="${BIN_DIR}/server-brave-search" \
+ && DEST="/usr/local/bin/server-brave-search" \
+ && if [ "${TARGET}" != "${DEST}" ]; then ln -sf "${TARGET}" "${DEST}"; fi \
+ \
+ # ===== 실행 가능 여부 확인 =====
+ && echo "=== npm bin 경로 확인 ===" \
+ && echo "${BIN_DIR}" \
+ && echo "=== server-brave-search 경로 확인(command -v) ===" \
+ && command -v server-brave-search \
+ && echo "=== server-brave-search 바이너리 확인 ===" \
+ && ls -l "${TARGET}" \
+ && if [ -e "${DEST}" ]; then ls -l "${DEST}"; fi \
+ && echo "=== server-brave-search --help 실행 ===" \
+ && server-brave-search --help \🤖 Prompt for AI Agents |
||
| && npm cache clean --force \ | ||
| && apt-get purge -y gnupg \ | ||
| && apt-get autoremove -y --purge \ | ||
|
|
@@ -35,8 +48,8 @@ RUN apt-get update \ | |
| # jar 복사 | ||
| COPY --from=builder /build/cs25-service/build/libs/*.jar app.jar | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainJAR 복사 글롭 충돌 가능성(다중 매칭 시 실패).
대안:
원하시면 Gradle 설정 변경까지 포함한 PR 보조 패치를 제안드릴 수 있습니다. 🏁 Script executed: #!/bin/bash
# cs25-service 모듈의 Gradle 설정에서 JAR 관련 태스크가 어떻게 정의됐는지 확인
rg -n "tasks\\.jar" -n cs25-service
rg -n "bootJar" -n cs25-service
rg -n "archiveFileName" -n cs25-serviceLength of output: 235 JAR 복사 glob 충돌 위험: 패턴 안정화 필요 현재 cs25-service/Dockerfile(49행)의 글롭 패턴
위 방법 중 하나를 선택해 Docker 이미지 빌드가 항상 단일 JAR을 복사하도록 수정해 주세요. 🤖 Prompt for AI Agents |
||
|
|
||
| # 포트 오픈 (service는 8080) | ||
| # 포트 오픈 | ||
| EXPOSE 8080 | ||
|
|
||
| # 실행 | ||
| ENTRYPOINT ["java", "-jar", "/apps/app.jar"] | ||
| ENTRYPOINT ["java", "-jar", "/apps/app.jar"] | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
curl | bash(노드소스 설치) 보안/재현성 개선 필요.
set -euxo pipefail추가를 권장합니다.ARG로 버전 주입).보안/재현성 개선 예시:
추가로, Dockerfile 상단(해당 단계 시작부)에 다음 ARG를 선언하면 버전 고정이 용이합니다:
원하시면 위 변경을 반영한 전체 RUN 블록을 정리해 드리겠습니다.
📝 Committable suggestion
🤖 Prompt for AI Agents