serve lms admin under subpath
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
VITE_API_BASE_URL=http://localhost:4400/api
|
||||
VITE_LAUNCHER_API_BASE_URL=http://localhost:4200/api
|
||||
VITE_PUBLIC_BASE_PATH=/lms-adm/
|
||||
VITE_ADS_IDE_AUTH_URL=http://localhost:4100
|
||||
@@ -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;"]
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
+13
-4
@@ -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({
|
||||
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
|
||||
}
|
||||
port: 5174,
|
||||
},
|
||||
build: {
|
||||
outDir: 'dist',
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user