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 @@ - - + NodeCrypt - - + +
@@ -77,8 +76,7 @@
- - - + + \ No newline at end of file diff --git a/web/NodeCrypt.js b/client/js/NodeCrypt.js similarity index 100% rename from web/NodeCrypt.js rename to client/js/NodeCrypt.js diff --git a/web/chat.js b/client/js/chat.js similarity index 100% rename from web/chat.js rename to client/js/chat.js diff --git a/web/main.js b/client/js/main.js similarity index 100% rename from web/main.js rename to client/js/main.js diff --git a/web/room.js b/client/js/room.js similarity index 100% rename from web/room.js rename to client/js/room.js diff --git a/web/ui.js b/client/js/ui.js similarity index 100% rename from web/ui.js rename to client/js/ui.js diff --git a/web/util.avatar.js b/client/js/util.avatar.js similarity index 100% rename from web/util.avatar.js rename to client/js/util.avatar.js diff --git a/web/util.dom.js b/client/js/util.dom.js similarity index 100% rename from web/util.dom.js rename to client/js/util.dom.js diff --git a/web/util.emoji.js b/client/js/util.emoji.js similarity index 100% rename from web/util.emoji.js rename to client/js/util.emoji.js diff --git a/web/util.image.js b/client/js/util.image.js similarity index 100% rename from web/util.image.js rename to client/js/util.image.js diff --git a/web/util.settings.js b/client/js/util.settings.js similarity index 100% rename from web/util.settings.js rename to client/js/util.settings.js diff --git a/web/util.string.js b/client/js/util.string.js similarity index 100% rename from web/util.string.js rename to client/js/util.string.js diff --git a/vite.config.js b/vite.config.js index 520d875..58aa927 100644 --- a/vite.config.js +++ b/vite.config.js @@ -4,7 +4,7 @@ import { export default defineConfig({ // Root directory // 根目录 - root: 'web', + root: 'client', // Base URL // 基础 URL base: './', @@ -37,10 +37,9 @@ export default defineConfig({ }, // Rollup options // Rollup 选项 - rollupOptions: { - // Input file + rollupOptions: { // Input file // 输入文件 - input: 'web/index.html', + input: 'client/index.html', // Output options // 输出选项 output: {