Files
crewai/Dockerfile

37 lines
860 B
Docker
Raw Normal View History

2026-03-13 21:09:44 +08:00
# SDLC Agent Demo - Dockerfile
# 基于 CrewAI + Qwen3.5-flash + FastAPI 的多智能体软件交付系统
2026-03-13 14:20:58 +08:00
2026-03-13 21:09:44 +08:00
FROM python:3.11-slim
2026-03-13 14:20:58 +08:00
# 设置环境变量
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1 \
2026-03-13 21:09:44 +08:00
PIP_DISABLE_PIP_VERSION_CHECK=1 \
PYTHONPATH=/app
2026-03-13 18:12:31 +08:00
2026-03-13 14:20:58 +08:00
# 设置工作目录
WORKDIR /app
2026-03-13 21:09:44 +08:00
# 安装系统依赖
2026-03-13 22:03:53 +08:00
#RUN apt-get update && apt-get install -y --no-install-recommends \
# gcc \
# && rm -rf /var/lib/apt/lists/*
2026-03-13 14:20:58 +08:00
2026-03-13 21:09:44 +08:00
# 安装 Python 依赖
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
2026-03-13 14:20:58 +08:00
# 复制应用代码
2026-03-13 18:12:31 +08:00
COPY . .
2026-03-13 14:20:58 +08:00
# 暴露端口
2026-03-13 21:09:44 +08:00
EXPOSE 8080
2026-03-13 14:20:58 +08:00
# 健康检查
2026-03-13 21:09:44 +08:00
HEALTHCHECK --interval=30s --timeout=10s --start-period=10s --retries=3 \
CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:8080/docs')" || exit 1
2026-03-13 14:20:58 +08:00
# 启动命令
2026-03-13 21:09:44 +08:00
CMD ["python", "main.py"]