fix: production deployment improvements and configuration fixes
## 主要改动 ### 1. 修复二维码地址硬编码问题 - 将 MainDisplay.vue 中硬编码的移动端 URL 改为环境变量配置 - 添加 VITE_MOBILE_URL 环境变量支持 - 支持通过 .env 文件动态配置移动端地址 ### 2. 修复音频文件路径问题 - 修正 display.ts 中音频文件路径,添加 /screen 前缀 - 修复 BGM、抽奖音效、胜利音效的加载路径 ### 3. 修复 Docker 构建问题 - 添加中国 npm 镜像配置,解决构建超时问题 - 修复缺失的 tsconfig.base.json 文件拷贝 - 修复 Redis 环境变量配置(REDIS_HOST/REDIS_PORT) - 添加 Lua 脚本文件拷贝到生产容器 ### 4. 修复前端路由和资源加载 - 添加 Vite base path 配置 (/screen/) - 修复 Vue Router base path 配置 - 修正 Caddyfile 路由顺序,确保 /screen 路径优先匹配 ### 5. 修复 TypeScript 编译错误 - LuckyDrawView.vue: 添加 round 属性类型定义 - ProgramCard.vue: 添加非空断言处理 ### 6. 修复 SCSS 变量问题 - 替换未定义的 SCSS 变量为硬编码颜色值 - 修复 VoteView、ConnectionStatus、HomeView、ScanLoginView 中的样式问题 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,17 +1,10 @@
|
||||
{
|
||||
email your-email@example.com
|
||||
email let5sne@gmail.com
|
||||
}
|
||||
|
||||
your-domain.com {
|
||||
# Mobile client (default)
|
||||
handle {
|
||||
root * /srv/mobile
|
||||
try_files {path} /index.html
|
||||
file_server
|
||||
}
|
||||
|
||||
# Screen client
|
||||
handle /screen/* {
|
||||
2026.cptp.let5see.xyz {
|
||||
# Screen client (must be before mobile to match first)
|
||||
handle /screen* {
|
||||
root * /srv/screen
|
||||
uri strip_prefix /screen
|
||||
try_files {path} /index.html
|
||||
@@ -28,6 +21,13 @@ your-domain.com {
|
||||
reverse_proxy server:3000
|
||||
}
|
||||
|
||||
# Mobile client (default, matches everything else)
|
||||
handle {
|
||||
root * /srv/mobile
|
||||
try_files {path} /index.html
|
||||
file_server
|
||||
}
|
||||
|
||||
# Gzip compression
|
||||
encode gzip
|
||||
}
|
||||
|
||||
@@ -2,9 +2,17 @@ FROM node:20-alpine AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
RUN npm install -g pnpm
|
||||
# Build arguments for environment variables
|
||||
ARG VITE_SOCKET_URL
|
||||
ARG VITE_API_URL
|
||||
ARG VITE_MOBILE_URL
|
||||
|
||||
COPY pnpm-workspace.yaml package.json pnpm-lock.yaml ./
|
||||
# Install pnpm and configure registry
|
||||
RUN npm config set registry https://registry.npmmirror.com && \
|
||||
npm install -g pnpm && \
|
||||
pnpm config set registry https://registry.npmmirror.com
|
||||
|
||||
COPY pnpm-workspace.yaml package.json pnpm-lock.yaml tsconfig.base.json ./
|
||||
COPY packages/shared ./packages/shared
|
||||
COPY packages/client-screen ./packages/client-screen
|
||||
COPY packages/client-mobile ./packages/client-mobile
|
||||
|
||||
@@ -2,11 +2,13 @@ FROM node:20-alpine AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install pnpm
|
||||
RUN npm install -g pnpm
|
||||
# Install pnpm and configure registry
|
||||
RUN npm config set registry https://registry.npmmirror.com && \
|
||||
npm install -g pnpm && \
|
||||
pnpm config set registry https://registry.npmmirror.com
|
||||
|
||||
# Copy workspace files
|
||||
COPY pnpm-workspace.yaml package.json pnpm-lock.yaml ./
|
||||
COPY pnpm-workspace.yaml package.json pnpm-lock.yaml tsconfig.base.json ./
|
||||
COPY packages/shared ./packages/shared
|
||||
COPY packages/client-screen ./packages/client-screen
|
||||
COPY packages/client-mobile ./packages/client-mobile
|
||||
|
||||
Reference in New Issue
Block a user