Files
AIclinicalresearch/Dockerfile.postgres-with-extensions
HaHafeng 2481b786d8 deploy: Complete 0126-27 deployment - database upgrade, services update, code recovery
Major Changes:
- Database: Install pg_bigm/pgvector plugins, create test database
- Python service: v1.0 -> v1.1, add pymupdf4llm/openpyxl/pypandoc
- Node.js backend: v1.3 -> v1.7, fix pino-pretty and ES Module imports
- Frontend: v1.2 -> v1.3, skip TypeScript check for deployment
- Code recovery: Restore empty files from local backup

Technical Fixes:
- Fix pino-pretty error in production (conditional loading)
- Fix ES Module import paths (add .js extensions)
- Fix OSSAdapter TypeScript errors
- Update Prisma Schema (63 models, 16 schemas)
- Update environment variables (DATABASE_URL, EXTRACTION_SERVICE_URL, OSS)
- Remove deprecated variables (REDIS_URL, DIFY_API_URL, DIFY_API_KEY)

Documentation:
- Create 0126 deployment folder with 8 documents
- Update database development standards v2.0
- Update SAE deployment status records

Deployment Status:
- PostgreSQL: ai_clinical_research_test with plugins
- Python: v1.1 @ 172.17.173.84:8000
- Backend: v1.7 @ 172.17.173.89:3001
- Frontend: v1.3 @ 172.17.173.90:80

Tested: All services running successfully on SAE
2026-01-27 08:13:27 +08:00

62 lines
1.7 KiB
Docker
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.
# PostgreSQL 15 with pgvector + pg_bigm extensions
# 用于 AI 临床研究平台的向量检索和中文关键词检索
#
# 扩展版本:
# - pgvector: 0.8.1 (向量相似度搜索)
# - pg_bigm: 1.2 (中日韩文本全文搜索)
#
# 构建命令:
# docker build -f Dockerfile.postgres-with-extensions -t ai-clinical-postgres:v1.1 .
#
# 使用方法:
# 1. 构建镜像后,修改 docker-compose.yml:
# image: ai-clinical-postgres:v1.1
# 2. 重启服务docker compose down && docker compose up -d
# 3. 启用扩展:
# docker exec -it ai-clinical-postgres psql -U postgres -d ai_clinical_research -c "CREATE EXTENSION IF NOT EXISTS pg_bigm;"
FROM pgvector/pgvector:pg15
# 使用阿里云镜像源加速(如果在国内)
# RUN sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list.d/*.sources 2>/dev/null || true
# 安装编译依赖
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
postgresql-server-dev-15 \
wget \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# 下载并编译 pg_bigm
# pg_bigm 是专门为中日韩CJK字符优化的全文搜索扩展
RUN cd /tmp \
&& wget -q https://github.com/pgbigm/pg_bigm/archive/refs/tags/v1.2-20200228.tar.gz \
&& tar -xzf v1.2-20200228.tar.gz \
&& cd pg_bigm-1.2-20200228 \
&& make USE_PGXS=1 \
&& make USE_PGXS=1 install \
&& cd / \
&& rm -rf /tmp/pg_bigm* /tmp/v1.2-20200228.tar.gz
# 清理编译依赖
RUN apt-get purge -y --auto-remove \
build-essential \
postgresql-server-dev-15 \
wget \
&& rm -rf /var/lib/apt/lists/*
# 添加初始化脚本(自动创建扩展)
COPY docker-init-extensions.sql /docker-entrypoint-initdb.d/
# 暴露端口
EXPOSE 5432