serve lms admin under subpath

This commit is contained in:
2026-07-08 09:01:01 +09:00
parent a940e02f75
commit 21952d2fd6
4 changed files with 27 additions and 8 deletions
+2 -1
View File
@@ -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
VITE_PUBLIC_BASE_PATH=/lms-adm/
VITE_ADS_IDE_AUTH_URL=http://localhost:4100
+1
View File
@@ -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;"]
+8
View File
@@ -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;
}
+16 -7
View File
@@ -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',
},
};
});