feat: Modal 小屏滚动 + 数据看板视频播放 + Docker Alpine 化
- 数据看板作者视频播放接口从 /api/video/stream 改为 /api/Video/play(后端只有 Play action,之前笔误导致 404) - 全局 Modal 小屏适配:body max-height + 自定义 10px 深色滚动条,兼容 full-modal 和登录页 login-modal - Docker 镜像换 Alpine + 内置 ffmpeg,避开 Ubuntu apt 网络问题 - 新增 .dockerignore 排除 node_modules / logs / videos / db 等构建噪音 - 移除已废弃的 DyQrCodeService(旧扫码登录) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
+8
-42
@@ -10,7 +10,7 @@ RUN npm config set registry https://registry.npmmirror.com && \
|
||||
npm install -g pnpm && \
|
||||
pnpm config set registry https://registry.npmmirror.com && \
|
||||
if [ -f pnpm-lock.yaml ]; then \
|
||||
pnpm install --frozen-lockfile; \
|
||||
pnpm install --no-frozen-lockfile; \
|
||||
else \
|
||||
npm install; \
|
||||
fi
|
||||
@@ -18,17 +18,11 @@ RUN npm config set registry https://registry.npmmirror.com && \
|
||||
COPY app/ ./
|
||||
RUN pnpm build || npm run build
|
||||
|
||||
# 第二阶段:构建后端 + 下载 Playwright Chromium
|
||||
FROM mcr.azurecr.cn/dotnet/sdk:6.0 AS backend-builder
|
||||
# 第二阶段:构建后端
|
||||
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS backend-builder
|
||||
|
||||
WORKDIR /src
|
||||
|
||||
# 安装 Node.js 18(用于 npx playwright install,最可靠的方式)
|
||||
RUN apt-get update && apt-get install -y curl && \
|
||||
curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \
|
||||
apt-get install -y nodejs && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY *.csproj ./
|
||||
RUN dotnet restore dy.net.csproj
|
||||
|
||||
@@ -39,46 +33,18 @@ COPY --from=frontend-builder /app/frontend/dist ./app/dist
|
||||
|
||||
RUN dotnet publish dy.net.csproj -c Release -o /app/publish
|
||||
|
||||
# 用 npx 下载 Playwright Chromium 到固定路径
|
||||
ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
|
||||
RUN npx -y playwright@1.44.0 install chromium
|
||||
|
||||
# 第三阶段:运行镜像
|
||||
FROM mcr.azurecr.cn/dotnet/aspnet:6.0 AS final
|
||||
# 第三阶段:运行镜像(Alpine 版:apk 包更小、代理下更易通过)
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:6.0-alpine AS final
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
ENV TZ=Asia/Shanghai
|
||||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||
|
||||
# 切换阿里云镜像源,解决国内网络无法访问 deb.debian.org 的问题
|
||||
RUN sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list && \
|
||||
sed -i 's/security.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list
|
||||
|
||||
# 安装 Chromium 运行时依赖(Debian Bullseye)
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
libnss3 \
|
||||
libatk1.0-0 \
|
||||
libatk-bridge2.0-0 \
|
||||
libcups2 \
|
||||
libdrm2 \
|
||||
libxkbcommon0 \
|
||||
libxcomposite1 \
|
||||
libxdamage1 \
|
||||
libxfixes3 \
|
||||
libxrandr2 \
|
||||
libgbm1 \
|
||||
libasound2 \
|
||||
libpango-1.0-0 \
|
||||
libpangocairo-1.0-0 \
|
||||
libgtk-3-0 \
|
||||
fonts-liberation \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
RUN apk add --no-cache tzdata ffmpeg && \
|
||||
cp /usr/share/zoneinfo/$TZ /etc/localtime && \
|
||||
echo $TZ > /etc/timezone
|
||||
|
||||
COPY --from=backend-builder /app/publish .
|
||||
COPY --from=backend-builder /ms-playwright /ms-playwright
|
||||
|
||||
ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
|
||||
EXPOSE 10101
|
||||
ENV ASPNETCORE_URLS=http://*:10101
|
||||
ENV ASPNETCORE_ENVIRONMENT=Production
|
||||
|
||||
Reference in New Issue
Block a user