bug fix
parent
ab95b1e498
commit
b64ade0525
|
|
@ -12,6 +12,7 @@ Thumbs.db
|
|||
|
||||
# Project storage (user uploaded files)
|
||||
storage/
|
||||
backup/
|
||||
|
||||
# Documentation files (可能是临时的)
|
||||
*.md.backup
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ ENV PYTHONUNBUFFERED=1 \
|
|||
PYTHONDONTWRITEBYTECODE=1 \
|
||||
PIP_NO_CACHE_DIR=1 \
|
||||
PIP_DISABLE_PIP_VERSION_CHECK=1 \
|
||||
DEBIAN_FRONTEND=noninteractive \
|
||||
PIP_DEFAULT_TIMEOUT=120
|
||||
|
||||
# 优先尝试阿里云 Debian 镜像源,失败时自动回退官方源
|
||||
|
|
@ -16,36 +17,34 @@ RUN set -eux; \
|
|||
cp /etc/apt/sources.list.d/debian.sources /tmp/debian.sources.bak; \
|
||||
sed -i 's|http://deb.debian.org|http://mirrors.aliyun.com|g' /etc/apt/sources.list.d/debian.sources; \
|
||||
sed -i 's|http://security.debian.org|http://mirrors.aliyun.com|g' /etc/apt/sources.list.d/debian.sources; \
|
||||
dpkg --configure -a || true; \
|
||||
apt-get -f install -y || true; \
|
||||
if ! apt-get update; then \
|
||||
cp /tmp/debian.sources.bak /etc/apt/sources.list.d/debian.sources; \
|
||||
dpkg --configure -a || true; \
|
||||
apt-get -f install -y || true; \
|
||||
apt-get update; \
|
||||
fi; \
|
||||
if ! apt-get install -y --no-install-recommends \
|
||||
build-essential \
|
||||
default-libmysqlclient-dev \
|
||||
pkg-config \
|
||||
libpango-1.0-0 \
|
||||
libpangoft2-1.0-0 \
|
||||
libpangocairo-1.0-0 \
|
||||
libgdk-pixbuf-2.0-0 \
|
||||
libcairo2 \
|
||||
libffi-dev \
|
||||
shared-mime-info \
|
||||
fontconfig \
|
||||
fonts-dejavu-core \
|
||||
fonts-wqy-microhei; then \
|
||||
cp /tmp/debian.sources.bak /etc/apt/sources.list.d/debian.sources; \
|
||||
dpkg --configure -a || true; \
|
||||
apt-get -f install -y || true; \
|
||||
apt-get update; \
|
||||
apt-get install -y --no-install-recommends \
|
||||
build-essential \
|
||||
default-libmysqlclient-dev \
|
||||
pkg-config \
|
||||
libpango-1.0-0 \
|
||||
libpangoft2-1.0-0 \
|
||||
libpangocairo-1.0-0 \
|
||||
libgdk-pixbuf-2.0-0 \
|
||||
libcairo2 \
|
||||
libffi-dev \
|
||||
shared-mime-info \
|
||||
fontconfig \
|
||||
fonts-dejavu-core \
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ services:
|
|||
MYSQL_PASSWORD: ${DB_PASSWORD:-password_change_me}
|
||||
TZ: Asia/Shanghai
|
||||
volumes:
|
||||
- mysql_data:/var/lib/mysql
|
||||
- ${STORAGE_PATH:-./storage}/mysql:/var/lib/mysql
|
||||
- ./backend/scripts/init.sql:/docker-entrypoint-initdb.d/init.sql:ro
|
||||
ports:
|
||||
- "${MYSQL_PORT:-3306}:3306"
|
||||
|
|
@ -35,7 +35,7 @@ services:
|
|||
environment:
|
||||
TZ: Asia/Shanghai
|
||||
volumes:
|
||||
- redis_data:/data
|
||||
- ${STORAGE_PATH:-./storage}/redis:/data
|
||||
ports:
|
||||
- "${REDIS_PORT:-6379}:6379"
|
||||
healthcheck:
|
||||
|
|
@ -105,12 +105,6 @@ services:
|
|||
timeout: 10s
|
||||
retries: 3
|
||||
|
||||
volumes:
|
||||
mysql_data:
|
||||
driver: local
|
||||
redis_data:
|
||||
driver: local
|
||||
|
||||
networks:
|
||||
default:
|
||||
name: nex-docus-network
|
||||
|
|
|
|||
|
|
@ -41,6 +41,33 @@ server {
|
|||
add_header Cache-Control "no-cache, no-store, must-revalidate";
|
||||
}
|
||||
|
||||
# MCP Streamable HTTP 反向代理
|
||||
location = /mcp {
|
||||
return 301 /mcp/;
|
||||
}
|
||||
|
||||
location /mcp/ {
|
||||
proxy_pass http://backend:8000/mcp/;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Connection "";
|
||||
|
||||
# MCP 可能返回流式响应,不能被 nginx 缓冲
|
||||
proxy_buffering off;
|
||||
proxy_request_buffering off;
|
||||
|
||||
# MCP 会话可能比普通 API 更长
|
||||
proxy_connect_timeout 60s;
|
||||
proxy_send_timeout 3600s;
|
||||
proxy_read_timeout 3600s;
|
||||
|
||||
add_header Cache-Control "no-cache, no-store, must-revalidate";
|
||||
}
|
||||
|
||||
# PDF.js worker 文件 - 必须返回正确的 MIME type
|
||||
location /pdf-worker/ {
|
||||
types {
|
||||
|
|
|
|||
Loading…
Reference in New Issue