반응형
클라우드 배포 서비스는 크게 이렇게 나눌 수 있어요.
☁️ 주요 클라우드 배포 서비스
🏢 빅3 클라우드 (IaaS/PaaS)
서비스특징
| AWS (Amazon) | 가장 넓은 서비스 생태계, EC2·Lambda·S3 등 |
| Google Cloud (GCP) | AI/ML 강점, Firebase 통합 |
| Azure (Microsoft) | 기업 환경·MS 제품 연동 강점 |
🚀 개발자 친화적 PaaS
서비스특징
| Vercel | Next.js 최적화, 프론트엔드 배포 최강 |
| Netlify | 정적 사이트·JAMstack 특화 |
| Railway | 풀스택 앱 간편 배포, DB 포함 |
| Render | Heroku 대체제, 무료 티어 있음 |
| Fly.io | 글로벌 엣지 배포, Docker 기반 |
| Heroku | 오랜 PaaS 강자, 유료화 이후 입지 축소 |
🐳 컨테이너/쿠버네티스
서비스특징
| AWS ECS / EKS | AWS 컨테이너 오케스트레이션 |
| Google GKE | 구글 관리형 쿠버네티스 |
| Azure AKS | 애저 쿠버네티스 |
| Docker Hub | 이미지 레지스트리 |
⚡ 서버리스 / 엣지
서비스특징
| AWS Lambda | 함수형 서버리스 원조 |
| Cloudflare Workers | 엣지 서버리스, 초고속 |
| Supabase | BaaS (백엔드 as a 서비스), PostgreSQL |
| Firebase | Google BaaS, 실시간 DB |
구글 클라우드(GCP) 배포 방법을 주요 서비스별로 정리해 드릴게요.
구글 클라우드(GCP) 배포 방법을 주요 서비스별로 정리해 드릴게요.
🚀 GCP 배포 방법 총정리
1️⃣ Cloud Run (가장 추천 - 컨테이너 서버리스)
bash
# 1. gcloud CLI 설치 후 로그인
gcloud auth login
gcloud config set project YOUR_PROJECT_ID
# 2. Docker 이미지 빌드 & GCR에 푸시
docker build -t gcr.io/YOUR_PROJECT_ID/my-app .
docker push gcr.io/YOUR_PROJECT_ID/my-app
# 3. Cloud Run 배포
gcloud run deploy my-app \
--image gcr.io/YOUR_PROJECT_ID/my-app \
--platform managed \
--region asia-northeast3 \ # 서울 리전
--allow-unauthenticated
2️⃣ App Engine (코드만 올리면 끝)
bash
# app.yaml 작성
runtime: python311 # 또는 nodejs20, go122 등
# 배포 명령어 하나로 끝
gcloud app deploy
3️⃣ GKE (Google Kubernetes Engine)
bash
# 클러스터 생성
gcloud container clusters create my-cluster \
--zone asia-northeast3-a \
--num-nodes 3
# kubectl 연결
gcloud container clusters get-credentials my-cluster
# 배포
kubectl apply -f deployment.yaml
kubectl apply -f service.yaml
4️⃣ Compute Engine (VM 직접 운영)
bash
# VM 인스턴스 생성
gcloud compute instances create my-vm \
--zone=asia-northeast3-a \
--machine-type=e2-medium \
--image-family=ubuntu-2204-lts \
--image-project=ubuntu-os-cloud
# SSH 접속 후 직접 앱 실행
gcloud compute ssh my-vm
5️⃣ Cloud Functions (함수형 서버리스)
bash
# index.js 또는 main.py 작성 후
gcloud functions deploy myFunction \
--runtime nodejs20 \
--trigger-http \
--allow-unauthenticated \
--region asia-northeast3
📊 서비스 선택 가이드
상황추천 서비스
| 컨테이너 앱, 빠른 배포 | Cloud Run ✅ |
| 코드만 올리고 싶음 | App Engine |
| 마이크로서비스, 대규모 | GKE |
| 완전한 서버 제어 필요 | Compute Engine |
| 단순 API 함수 | Cloud Functions |
🔧 공통 사전 준비
bash
# 1. gcloud CLI 설치
# https://cloud.google.com/sdk/docs/install
# 2. 프로젝트 설정
gcloud projects create YOUR_PROJECT_ID
gcloud config set project YOUR_PROJECT_ID
# 3. 결제 계정 연결 (콘솔에서)
# console.cloud.google.com
# 4. 필요한 API 활성화
gcloud services enable run.googleapis.com
gcloud services enable cloudbuild.googleapis.com
MCP 서버를 클라우드에 배포해서 Claude와 연결
🎯 전체 흐름
MCP 서버 코드 → Docker 빌드 → Cloud Run 배포 → HTTPS URL 획득 → Claude MCP 연결
1️⃣ MCP 서버 준비 (예: Python)
python
# server.py
from mcp.server.fastmcp import FastMCP
mcp = FastMCP("my-server")
@mcp.tool()
def hello(name: str) -> str:
return f"Hello, {name}!"
if __name__ == "__main__":
mcp.run(transport="sse") # SSE transport 필수!
txt
# requirements.txt
mcp[cli]
uvicorn
2️⃣ Dockerfile
dockerfile
FROM python:3.11-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
EXPOSE 8080
CMD ["python", "server.py"]
3️⃣ Cloud Run 배포
bash
# 프로젝트 설정
gcloud config set project YOUR_PROJECT_ID
# 빌드 & 배포 한 번에
gcloud run deploy my-mcp-server \
--source . \
--region asia-northeast3 \
--allow-unauthenticated \
--port 8080
배포 완료되면 이런 URL 받아요:
https://my-mcp-server-xxxxxxxxxx-du.a.run.app
4️⃣ Claude에 MCP 연결
claude.ai (Artifacts API 방식)
javascript
mcp_servers: [
{
type: "url",
url: "https://my-mcp-server-xxxxxxxxxx-du.a.run.app/sse",
name: "my-mcp-server"
}
]
Claude Desktop (claude_desktop_config.json)
json
{
"mcpServers": {
"my-server": {
"url": "https://my-mcp-server-xxxxxxxxxx-du.a.run.app/sse",
"transport": "sse"
}
}
}
⚠️ Cloud Run MCP 주의사항
항목내용
| Transport | sse 또는 streamable-http 사용 |
| 포트 | 반드시 8080 |
| 인증 | 우선 --allow-unauthenticated, 나중에 API Key 추가 |
| Cold Start | 첫 요청 느릴 수 있음 → --min-instances 1 옵션 |
| 타임아웃 | 기본 60초 → SSE는 --timeout 3600 권장 |
bash
# 타임아웃 설정 추가한 배포
gcloud run deploy my-mcp-server \
--source . \
--region asia-northeast3 \
--allow-unauthenticated \
--port 8080 \
--timeout 3600 \
--min-instances 1
GCP Cloud Run → MCP 연결 치트시트
markdown
# GCP Cloud Run MCP 서버 배포
## 사전준비
gcloud auth login
gcloud config set project YOUR_PROJECT_ID
gcloud services enable run.googleapis.com cloudbuild.googleapis.com
## 파일 구조
my-mcp-server/
├── server.py
├── requirements.txt
└── Dockerfile
## server.py
from mcp.server.fastmcp import FastMCP
mcp = FastMCP("my-server")
@mcp.tool()
def hello(name: str) -> str:
return f"Hello, {name}!"
if __name__ == "__main__":
mcp.run(transport="sse")
## requirements.txt
mcp[cli]
uvicorn
## Dockerfile
FROM python:3.11-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
EXPOSE 8080
CMD ["python", "server.py"]
## 배포 (타임아웃/인스턴스 포함)
gcloud run deploy my-mcp-server \
--source . \
--region asia-northeast3 \
--allow-unauthenticated \
--port 8080 \
--timeout 3600 \
--min-instances 1
## 결과 URL
https://my-mcp-server-xxxxxxxxxx-du.a.run.app
## Claude Desktop 연결 (claude_desktop_config.json)
{
"mcpServers": {
"my-server": {
"url": "https://my-mcp-server-xxxxxxxxxx-du.a.run.app/sse",
"transport": "sse"
}
}
}
## Artifacts API 연결
mcp_servers: [{ type: "url", url: "...URL.../sse", name: "my-mcp-server" }]
## 주의
- transport: sse 필수
- 포트: 8080 고정
- SSE timeout: 3600 권장
- Cold start 방지: --min-instances 1
26-04-25 클라우드 코딩 작업일지 참조
'클로드(claude) > 클로드코드 사용일지' 카테고리의 다른 글
| 제주도지역 옥상 우수량 산출기 — 개발 과정 및 산정 방법론 (0) | 2026.05.27 |
|---|---|
| 🎙️ 시리로 Claude 음성 비서 만들기 (0) | 2026.05.18 |
| Claude Code + ECC 환경 설정 정리 (2026-04-29) (0) | 2026.04.29 |
| GCP Cloud Run MCP 서버 배포 기록 (0) | 2026.04.27 |
| 2026-04-24 작업 일지 — AgentShield 보안 스캔 및 수정 (0) | 2026.04.25 |