serve lms admin under subpath
This commit is contained in:
+2
-1
@@ -1,3 +1,4 @@
|
|||||||
VITE_API_BASE_URL=http://localhost:4400/api
|
VITE_API_BASE_URL=http://localhost:4400/api
|
||||||
VITE_LAUNCHER_API_BASE_URL=http://localhost:4200/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
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ RUN npm run build
|
|||||||
FROM nginx:1.27-alpine
|
FROM nginx:1.27-alpine
|
||||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
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
|
||||||
|
COPY --from=builder /app/dist /usr/share/nginx/html/lms-adm
|
||||||
|
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
CMD ["nginx", "-g", "daemon off;"]
|
CMD ["nginx", "-g", "daemon off;"]
|
||||||
|
|||||||
@@ -5,6 +5,14 @@ server {
|
|||||||
root /usr/share/nginx/html;
|
root /usr/share/nginx/html;
|
||||||
index index.html;
|
index index.html;
|
||||||
|
|
||||||
|
location = /lms-adm {
|
||||||
|
return 301 /lms-adm/;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /lms-adm/ {
|
||||||
|
try_files $uri $uri/ /lms-adm/index.html;
|
||||||
|
}
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
try_files $uri $uri/ /index.html;
|
try_files $uri $uri/ /index.html;
|
||||||
}
|
}
|
||||||
|
|||||||
+16
-7
@@ -1,11 +1,20 @@
|
|||||||
import { defineConfig } from 'vite';
|
import { defineConfig, loadEnv } from 'vite';
|
||||||
import react from '@vitejs/plugin-react';
|
import react from '@vitejs/plugin-react';
|
||||||
import tailwindcss from '@tailwindcss/vite';
|
import tailwindcss from '@tailwindcss/vite';
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig(({ mode }) => {
|
||||||
plugins: [react(), tailwindcss()],
|
const env = loadEnv(mode, '.', '');
|
||||||
server: {
|
const base = env.VITE_PUBLIC_BASE_PATH ?? '/';
|
||||||
host: '0.0.0.0',
|
|
||||||
port: 5174
|
return {
|
||||||
}
|
base,
|
||||||
|
plugins: [react(), tailwindcss()],
|
||||||
|
server: {
|
||||||
|
host: '0.0.0.0',
|
||||||
|
port: 5174,
|
||||||
|
},
|
||||||
|
build: {
|
||||||
|
outDir: 'dist',
|
||||||
|
},
|
||||||
|
};
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user