升级到 PostgreSQL 并添加 Docker Compose 部署
主要更新: - 替换 SQLite 为 PostgreSQL 数据库 - 添加 Docker Compose 配置文件 - 添加 Dockerfile 支持容器化部署 - 更新 README 添加详细的智能体注册指南 - 添加 .env.example 环境变量模板 - 修复 uuid 模块兼容性问题(降级到 9.x) - 完善 API 文档和使用示例
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
# PostgreSQL 数据库
|
||||
postgres:
|
||||
image: postgres:15-alpine
|
||||
container_name: agent-task-postgres
|
||||
environment:
|
||||
POSTGRES_DB: agent_tasks
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: postgres
|
||||
ports:
|
||||
- "5432:5432"
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U postgres"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
networks:
|
||||
- agent-network
|
||||
|
||||
# 应用服务
|
||||
app:
|
||||
build: .
|
||||
container_name: agent-task-service
|
||||
environment:
|
||||
DB_HOST: postgres
|
||||
DB_PORT: 5432
|
||||
DB_NAME: agent_tasks
|
||||
DB_USER: postgres
|
||||
DB_PASSWORD: postgres
|
||||
PORT: 3000
|
||||
ports:
|
||||
- "3000:3000"
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
networks:
|
||||
- agent-network
|
||||
restart: unless-stopped
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
driver: local
|
||||
|
||||
networks:
|
||||
agent-network:
|
||||
driver: bridge
|
||||
Reference in New Issue
Block a user