28 lines
534 B
Docker
28 lines
534 B
Docker
FROM python:3.11-slim
|
|
|
|
WORKDIR /app
|
|
|
|
# 安装系统依赖
|
|
RUN apt-get update && apt-get install -y \
|
|
libpq-dev \
|
|
build-essential \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# 安装Python依赖
|
|
RUN pip install --no-cache-dir \
|
|
langchain==0.1.0 \
|
|
langchain-community==0.0.10 \
|
|
langchain-openai==0.0.2 \
|
|
openai==1.7.2 \
|
|
psycopg2-binary==2.9.9 \
|
|
sqlalchemy==2.0.23
|
|
|
|
# 复制agent代码
|
|
COPY postgresql_agent.py .
|
|
|
|
# 设置环境变量
|
|
ENV PYTHONUNBUFFERED=1
|
|
|
|
# 运行agent
|
|
CMD ["python", "postgresql_agent.py"]
|