From 97043579bc228818629012019bab4900fa9dca32 Mon Sep 17 00:00:00 2001 From: web-admin Date: Wed, 8 Jul 2026 00:01:45 +0000 Subject: [PATCH] platform/lms-adm-fe release promotion snapshot --- .env.example | 3 ++- Dockerfile | 1 + nginx.conf | 8 ++++++++ vite.config.ts | 23 ++++++++++++++++------- 4 files changed, 27 insertions(+), 8 deletions(-) diff --git a/.env.example b/.env.example index 9fa4f28..e1b3331 100644 --- a/.env.example +++ b/.env.example @@ -1,3 +1,4 @@ VITE_API_BASE_URL=http://localhost:4400/api VITE_LAUNCHER_API_BASE_URL=http://localhost:4200/api -VITE_ADS_IDE_AUTH_URL=http://localhost:4100 \ No newline at end of file +VITE_PUBLIC_BASE_PATH=/lms-adm/ +VITE_ADS_IDE_AUTH_URL=http://localhost:4100 diff --git a/Dockerfile b/Dockerfile index 2acf836..5f16668 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,6 +10,7 @@ RUN npm run build FROM nginx:1.27-alpine COPY nginx.conf /etc/nginx/conf.d/default.conf COPY --from=builder /app/dist /usr/share/nginx/html +COPY --from=builder /app/dist /usr/share/nginx/html/lms-adm EXPOSE 80 CMD ["nginx", "-g", "daemon off;"] diff --git a/nginx.conf b/nginx.conf index 28b58d8..68cf5e8 100644 --- a/nginx.conf +++ b/nginx.conf @@ -5,6 +5,14 @@ server { root /usr/share/nginx/html; index index.html; + location = /lms-adm { + return 301 /lms-adm/; + } + + location /lms-adm/ { + try_files $uri $uri/ /lms-adm/index.html; + } + location / { try_files $uri $uri/ /index.html; } diff --git a/vite.config.ts b/vite.config.ts index d9892d8..a0de813 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,11 +1,20 @@ -import { defineConfig } from 'vite'; +import { defineConfig, loadEnv } from 'vite'; import react from '@vitejs/plugin-react'; import tailwindcss from '@tailwindcss/vite'; -export default defineConfig({ - plugins: [react(), tailwindcss()], - server: { - host: '0.0.0.0', - port: 5174 - } +export default defineConfig(({ mode }) => { + const env = loadEnv(mode, '.', ''); + const base = env.VITE_PUBLIC_BASE_PATH ?? '/'; + + return { + base, + plugins: [react(), tailwindcss()], + server: { + host: '0.0.0.0', + port: 5174, + }, + build: { + outDir: 'dist', + }, + }; });