version: "3.8" services: postgres-agent: image: pgvector/pgvector:pg16 container_name: qwen-agent-postgres environment: - POSTGRES_USER=postgres - POSTGRES_PASSWORD=E5ACJo6zJub4QS - POSTGRES_DB=agent_db ports: - "5432:5432" volumes: - postgres_data:/var/lib/postgresql/data restart: unless-stopped healthcheck: test: ["CMD-SHELL", "pg_isready -U postgres"] interval: 10s timeout: 5s retries: 5 start_period: 10s qwen-agent: build: context: . dockerfile: Dockerfile.modelscope container_name: qwen-agent-api ports: - "8001:8001" environment: # 应用配置 - MAX_CONTEXT_TOKENS=262144 - DEFAULT_THINKING_ENABLE=true - PROFILE=low_memory - RAGFLOW_API_URL=http://ragflow-cpu - RAGFLOW_API_KEY=ragflow-0vldzYY_SfQLnjBIGOBDDgvdgWemdK4gmH1L7kgenQ0 # PostgreSQL 配置 - CHECKPOINT_DB_URL=postgresql://postgres:E5ACJo6zJub4QS@postgres-agent:5432/agent_db volumes: # 挂载项目数据目录 - ./projects:/app/projects - ./models:/app/models depends_on: postgres-agent: condition: service_healthy restart: unless-stopped healthcheck: test: ["CMD", "curl", "-f", "http://localhost:8001/api/health"] interval: 30s timeout: 10s retries: 3 start_period: 40s networks: - default - ragflow volumes: postgres_data: networks: ragflow: name: docker_ragflow external: true