Files
AIclinicalresearch/redcap-docker-dev/docker-compose.prod.yml
HaHafeng b31255031e feat(iit-manager): Add WeChat Official Account integration for patient notifications
Features:
- PatientWechatCallbackController for URL verification and message handling
- PatientWechatService for template and customer messages
- Support for secure mode (message encryption/decryption)
- Simplified route /wechat/patient/callback for WeChat config
- Event handlers for subscribe/unsubscribe/text messages
- Template message for visit reminders

Technical details:
- Reuse @wecom/crypto for encryption (compatible with Official Account)
- Relaxed Fastify schema validation to prevent early request blocking
- Access token caching (7000s with 5min pre-refresh)
- Comprehensive logging for debugging

Testing: Local URL verification passed, ready for SAE deployment

Status: Code complete, waiting for WeChat platform configuration
2026-01-04 22:53:42 +08:00

132 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