Agent 2.0 exdev 서버 배포 스택
- server-dev start/stop/deploy 및 Gitea push 자동 배포 - local-dev 로컬 개발 환경 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
# docker/base-slim.Dockerfile
|
||||
# 경량 베이스 이미지 (외부 API 사용 버전)
|
||||
FROM python:3.11-slim
|
||||
|
||||
# 작업 디렉토리
|
||||
WORKDIR /app
|
||||
|
||||
# 시스템 패키지 (최소한만)
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends \
|
||||
curl \
|
||||
ca-certificates && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Python 패키지 (외부 API 사용에 필요한 것만)
|
||||
RUN pip install --no-cache-dir \
|
||||
httpx==0.27.0 \
|
||||
tenacity==8.2.3 \
|
||||
faiss-cpu==1.8.0 \
|
||||
fastapi==0.109.0 \
|
||||
uvicorn==0.27.0 \
|
||||
pydantic==2.6.0 \
|
||||
numpy==1.26.4 \
|
||||
qdrant-client==1.18.0
|
||||
|
||||
# 헬스체크
|
||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
||||
CMD curl -f http://localhost:28012/health || exit 1
|
||||
|
||||
EXPOSE 28012
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
# docker/base.Dockerfile
|
||||
FROM pytorch/pytorch:2.2.2-cuda12.1-cudnn8-devel
|
||||
ENV CUDA_HOME=/usr/local/cuda
|
||||
|
||||
# 1) 필수 OS 패키지 + CA
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends \
|
||||
ca-certificates curl gnupg git && \
|
||||
update-ca-certificates
|
||||
|
||||
# 2) Python 패키지
|
||||
# docker/base.Dockerfile – Python 패키지 설치 단계
|
||||
# 1) Python 패키지 설치
|
||||
RUN pip install --no-cache-dir --upgrade \
|
||||
--trusted-host pypi.org --trusted-host files.pythonhosted.org \
|
||||
tokenizers==0.21.2 \
|
||||
faiss-cpu==1.8.0 \
|
||||
sentence-transformers \
|
||||
transformers==4.55.0 \
|
||||
accelerate bitsandbytes==0.43.2 \
|
||||
safetensors==0.4.3 \
|
||||
FlagEmbedding \
|
||||
# flash-attn==2.4.2 \
|
||||
fastapi uvicorn
|
||||
|
||||
# 2) torch 에 uint64 심볼 임시 추가 (safetensors import 전에 실행)
|
||||
RUN python - <<'PY'
|
||||
import torch, types, sys
|
||||
if not hasattr(torch, "uint64"):
|
||||
torch.uint64 = torch.int64
|
||||
print("✔ torch.uint64 patched:", hasattr(torch, "uint64"))
|
||||
PY
|
||||
@@ -0,0 +1,32 @@
|
||||
# docker/batch-slim.Dockerfile
|
||||
# 배치 작업용 경량 이미지
|
||||
FROM python:3.11-slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# 시스템 패키지
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends \
|
||||
curl \
|
||||
ca-certificates && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Python 패키지
|
||||
RUN pip install --no-cache-dir \
|
||||
httpx==0.27.0 \
|
||||
tenacity==8.2.3 \
|
||||
faiss-cpu==1.8.0 \
|
||||
numpy==1.26.4 \
|
||||
qdrant-client==1.18.0 \
|
||||
pandas==2.2.0 \
|
||||
openpyxl==3.1.2 \
|
||||
packaging==24.0
|
||||
|
||||
# 스크립트 복사
|
||||
COPY scripts/ /app/scripts/
|
||||
|
||||
# Python 모듈 경로에 scripts 디렉토리 추가
|
||||
ENV PYTHONPATH="/app/scripts:${PYTHONPATH}"
|
||||
|
||||
CMD ["python"]
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
FROM rag-demo-base:latest
|
||||
|
||||
WORKDIR /app
|
||||
COPY scripts/*.py ./scripts/
|
||||
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
# docker/service-slim.Dockerfile
|
||||
# API 서비스용 경량 이미지
|
||||
FROM python:3.11-slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# 시스템 패키지
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends \
|
||||
curl \
|
||||
ca-certificates && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Python 패키지
|
||||
RUN pip install --no-cache-dir \
|
||||
httpx==0.27.0 \
|
||||
tenacity==8.2.3 \
|
||||
faiss-cpu==1.8.0 \
|
||||
fastapi==0.109.0 \
|
||||
uvicorn==0.27.0 \
|
||||
pydantic==2.6.0 \
|
||||
numpy==1.26.4 \
|
||||
qdrant-client==1.18.0 \
|
||||
packaging==24.0 \
|
||||
pymongo==4.6.1
|
||||
|
||||
# 스크립트 복사
|
||||
COPY scripts/ /app/scripts/
|
||||
|
||||
# Python 모듈 경로에 scripts 디렉토리 추가
|
||||
ENV PYTHONPATH="/app/scripts:${PYTHONPATH}"
|
||||
|
||||
# API 서버 실행 (멀티 워커)
|
||||
CMD ["python", "-m", "uvicorn", "scripts.run_service_qa:app", \
|
||||
"--host", "0.0.0.0", \
|
||||
"--port", "28012", \
|
||||
"--workers", "4"]
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
FROM rag-demo-base:latest
|
||||
|
||||
WORKDIR /app
|
||||
COPY scripts/run_service_qa.py .
|
||||
|
||||
EXPOSE 28012
|
||||
CMD ["uvicorn", "run_service_qa:app", "--host", "0.0.0.0", "--port", "28012"]
|
||||
Reference in New Issue
Block a user