From ffc73a42120013e554a24263ec05533fdaa4bd0b Mon Sep 17 00:00:00 2001 From: shuaiplus <2327005759@qq.com> Date: Sat, 24 May 2025 18:56:09 +0800 Subject: [PATCH] =?UTF-8?q?web->client=EF=BC=8C=E7=BB=93=E6=9E=84=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 12 +++++------- {web => client/assets}/favicon.svg | 0 {web => client/assets}/wallpaper.png | Bin {web => client/css}/style.css | 5 ++--- {web => client}/index.html | 12 +++++------- {web => client/js}/NodeCrypt.js | 0 {web => client/js}/chat.js | 0 {web => client/js}/main.js | 0 {web => client/js}/room.js | 0 {web => client/js}/ui.js | 0 {web => client/js}/util.avatar.js | 0 {web => client/js}/util.dom.js | 0 {web => client/js}/util.emoji.js | 0 {web => client/js}/util.image.js | 0 {web => client/js}/util.settings.js | 0 {web => client/js}/util.string.js | 0 vite.config.js | 7 +++---- 17 files changed, 15 insertions(+), 21 deletions(-) rename {web => client/assets}/favicon.svg (100%) rename {web => client/assets}/wallpaper.png (100%) rename {web => client/css}/style.css (99%) rename {web => client}/index.html (97%) rename {web => client/js}/NodeCrypt.js (100%) rename {web => client/js}/chat.js (100%) rename {web => client/js}/main.js (100%) rename {web => client/js}/room.js (100%) rename {web => client/js}/ui.js (100%) rename {web => client/js}/util.avatar.js (100%) rename {web => client/js}/util.dom.js (100%) rename {web => client/js}/util.emoji.js (100%) rename {web => client/js}/util.image.js (100%) rename {web => client/js}/util.settings.js (100%) rename {web => client/js}/util.string.js (100%) diff --git a/Dockerfile b/Dockerfile index 920fe9c..d1e9642 100644 --- a/Dockerfile +++ b/Dockerfile @@ -31,7 +31,7 @@ RUN npm ci --no-audit || npm install --no-audit # Copy source code and configuration files # 复制源代码和配置文件 COPY vite.config.js ./ -COPY web/ ./web/ +COPY client/ ./client/ # Build the frontend # 构建前端 @@ -44,7 +44,7 @@ FROM docker.1ms.run/alpine:3.16 # Install minimal Node.js and Nginx # 安装最小化版本的 Node.js 和 Nginx RUN apk add --no-cache nodejs nginx && \ - mkdir -p /app/server /app/web /run/nginx && \ + mkdir -p /app/server /app/client /run/nginx && \ # Clean up apk cache # 清理 apk 缓存 rm -rf /var/cache/apk/* @@ -55,7 +55,7 @@ COPY --from=backend-builder /app/server/node_modules /app/server/node_modules COPY --from=backend-builder /app/server/*.js /app/server/ # Copy built frontend files from the frontend build stage # 从前端构建阶段复制构建好的文件,而不是复制 dist 目录 -COPY --from=frontend-builder /app/dist/ /app/web/ +COPY --from=frontend-builder /app/dist/ /app/client/ # Optimized Nginx configuration # 优化的 Nginx 配置 @@ -91,12 +91,10 @@ http { server { listen 80; - server_name localhost; - - # Serve static files + server_name localhost; # Serve static files # 提供静态文件服务 location / { - root /app/web; + root /app/client; index index.html; try_files $uri $uri/ /index.html; } diff --git a/web/favicon.svg b/client/assets/favicon.svg similarity index 100% rename from web/favicon.svg rename to client/assets/favicon.svg diff --git a/web/wallpaper.png b/client/assets/wallpaper.png similarity index 100% rename from web/wallpaper.png rename to client/assets/wallpaper.png diff --git a/web/style.css b/client/css/style.css similarity index 99% rename from web/style.css rename to client/css/style.css index f1b0e63..722f7d6 100644 --- a/web/style.css +++ b/client/css/style.css @@ -330,11 +330,10 @@ body { flex: 2.5; } -.main::before { - content: ""; +.main::before { content: ""; position: absolute; inset: 0; - background: url(./wallpaper.png) left top / auto 100% no-repeat; + background: url(../assets/wallpaper.png) left top / auto 100% no-repeat; opacity: 0.15; mix-blend-mode: multiply; pointer-events: none; diff --git a/web/index.html b/client/index.html similarity index 97% rename from web/index.html rename to client/index.html index 8c63ba5..d129bd3 100644 --- a/web/index.html +++ b/client/index.html @@ -1,11 +1,10 @@ -
- +