Files
AIclinicalresearch/redcap-docker-dev/docker-compose.prod.yml
HaHafeng 96290d2f76 feat(aia): Implement Protocol Agent MVP with reusable Agent framework
Sprint 1-3 Completed (Backend + Frontend):

Backend (Sprint 1-2):
- Implement 5-layer Agent framework (Query->Planner->Executor->Tools->Reflection)
- Create agent_schema with 6 tables (agent_definitions, stages, prompts, sessions, traces, reflexion_rules)
- Create protocol_schema with 2 tables (protocol_contexts, protocol_generations)
- Implement Protocol Agent core services (Orchestrator, ContextService, PromptBuilder)
- Integrate LLM service adapter (DeepSeek/Qwen/GPT-5/Claude)
- 6 API endpoints with full authentication
- 10/10 API tests passed

Frontend (Sprint 3):
- Add Protocol Agent entry in AgentHub (indigo theme card)
- Implement ProtocolAgentPage with 3-column layout
- Collapsible sidebar (Gemini style, 48px <-> 280px)
- StatePanel with 5 stage cards (scientific_question, pico, study_design, sample_size, endpoints)
- ChatArea with sync button and action cards integration
- 100% prototype design restoration (608 lines CSS)
- Detailed endpoints structure: baseline, exposure, outcomes, confounders

Features:
- 5-stage dialogue flow for research protocol design
- Conversation-driven interaction with sync-to-protocol button
- Real-time context state management
- One-click protocol generation button (UI ready, backend pending)

Database:
- agent_schema: 6 tables for reusable Agent framework
- protocol_schema: 2 tables for Protocol Agent
- Seed data: 1 agent + 5 stages + 9 prompts + 4 reflexion rules

Code Stats:
- Backend: 13 files, 4338 lines
- Frontend: 14 files, 2071 lines
- Total: 27 files, 6409 lines

Status: MVP core functionality completed, pending frontend-backend integration testing

Next: Sprint 4 - One-click protocol generation + Word export
2026-01-24 17:29:24 +08:00

163 lines
3.4 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# REDCap Docker Compose 配置 - 生产环境
# 版本v1.0
# 日期2026-01-01
# 用途阿里云ECS生产环境或医院内网部署
# 差异移除phpMyAdmin配置RDS MySQL添加资源限制
version: '3.8'
services:
# ========== REDCap Web服务 (Apache + PHP 8.1 + REDCap) ==========
redcap-web:
build:
context: .
dockerfile: Dockerfile.redcap
container_name: redcap-apache
restart: always
ports:
- "80:80"
# 如需HTTPS添加
# - "443:443"
volumes:
# REDCap源代码只读
- ../redcap15.8.0/redcap:/var/www/html/redcap:ro
# 配置文件
- ./config/apache/redcap.conf:/etc/apache2/sites-available/000-default.conf:ro
- ./config/php/php.ini:/usr/local/etc/php/php.ini:ro
- ./config/database.php:/var/www/html/redcap/database.php:ro
# SSL证书如需HTTPS
# - ./ssl/cert.pem:/etc/ssl/certs/redcap.crt:ro
# - ./ssl/key.pem:/etc/ssl/private/redcap.key:ro
# 持久化数据(可读写)
- redcap-edocs:/var/www/html/redcap/edocs
- redcap-modules:/var/www/html/redcap/modules
- redcap-temp:/var/www/html/redcap/temp
environment:
# 数据库连接信息使用RDS
# 注意:生产环境应从环境变量读取,不要写死在配置文件中
REDCAP_DB_HOST: ${REDCAP_DB_HOST} # RDS内网地址rm-xxx.mysql.rds.aliyuncs.com
REDCAP_DB_PORT: ${REDCAP_DB_PORT:-3306}
REDCAP_DB_NAME: ${MYSQL_DATABASE}
REDCAP_DB_USER: ${MYSQL_USER}
REDCAP_DB_PASS: ${MYSQL_PASSWORD}
# PHP配置
TZ: Asia/Shanghai
networks:
- redcap-network
deploy:
resources:
limits:
cpus: '2'
memory: 4G
reservations:
cpus: '1'
memory: 2G
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost/"]
interval: 30s
timeout: 10s
retries: 3
# ========== MySQL 容器可选如不使用RDS ==========
# 注意生产环境强烈推荐使用阿里云RDS MySQL
# 如需使用Docker MySQL取消下方注释
#
# redcap-db:
# image: mysql:8.0
# container_name: redcap-mysql
# restart: always
# environment:
# MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
# MYSQL_DATABASE: ${MYSQL_DATABASE}
# MYSQL_USER: ${MYSQL_USER}
# MYSQL_PASSWORD: ${MYSQL_PASSWORD}
# volumes:
# - redcap-db-data:/var/lib/mysql
# ports:
# - "3306:3306"
# networks:
# - redcap-network
# command: --default-authentication-plugin=mysql_native_password
# deploy:
# resources:
# limits:
# cpus: '1'
# memory: 2G
# reservations:
# cpus: '0.5'
# memory: 1G
# ========== 网络配置 ==========
networks:
redcap-network:
driver: bridge
name: redcap-network
# ========== 数据卷配置 ==========
volumes:
# MySQL数据如使用Docker MySQL
# redcap-db-data:
# name: redcap-db-data
# driver: local
# REDCap上传文件持久化
redcap-edocs:
name: redcap-edocs
driver: local
# External Modules持久化
redcap-modules:
name: redcap-modules
driver: local
# 临时文件(可定期清理)
redcap-temp:
name: redcap-temp
driver: local