Add non Docker deployment entrypoints

This commit is contained in:
2026-06-09 11:32:34 +08:00
parent fe0133edc4
commit 1fafaa1d03
13 changed files with 299 additions and 90 deletions
+19 -1
View File
@@ -11,6 +11,18 @@ server {
gzip_vary on;
gzip_proxied any;
location /ai-agent-admin/basic-api/ {
rewrite ^/ai-agent-admin/basic-api/(.*) /$1 break;
proxy_pass http://backend:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_connect_timeout 60s;
proxy_read_timeout 60s;
proxy_send_timeout 60s;
}
location /basic-api/ {
rewrite ^/basic-api/(.*) /$1 break;
proxy_pass http://backend:8000;
@@ -42,6 +54,12 @@ server {
add_header Cache-Control "no-cache, no-store, must-revalidate";
}
location /ai-agent-admin/ {
try_files $uri $uri/ /ai-agent-admin/index.html;
expires -1;
add_header Cache-Control "no-cache, no-store, must-revalidate";
}
location /assets/ {
expires 1y;
add_header Cache-Control "public, immutable";
@@ -53,7 +71,7 @@ server {
log_not_found off;
}
error_page 404 /index.html;
error_page 404 /ai-agent-admin/index.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
+35
View File
@@ -0,0 +1,35 @@
FROM node:22-alpine AS builder
WORKDIR /app
ENV PNPM_HOME=/pnpm \
PATH=/pnpm:$PATH \
NODE_OPTIONS=--max-old-space-size=4096
RUN corepack enable
COPY web/ ./
RUN pnpm install --frozen-lockfile
ARG VITE_APP_TITLE=AI Agent Admin
ARG VITE_BASE=/ai-agent-admin/
ARG VITE_GLOB_API_URL=/ai-agent-admin/basic-api
ENV VITE_APP_TITLE=$VITE_APP_TITLE \
VITE_BASE=$VITE_BASE \
VITE_GLOB_API_URL=$VITE_GLOB_API_URL \
VITE_COMPRESS=none \
VITE_PWA=false
RUN pnpm --filter @vben/web-ele build
FROM nginx:1.27-alpine
COPY docker/nginx/nginx.conf /etc/nginx/nginx.conf
COPY docker/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf
COPY --from=builder /app/apps/web-ele/dist/ /usr/share/nginx/html/ai-agent-admin/
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
+11
View File
@@ -0,0 +1,11 @@
FROM nginx:1.27-alpine
COPY docker/nginx/nginx.conf /etc/nginx/nginx.conf
COPY docker/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf
COPY docker/web/index/ /usr/share/nginx/html/ai-agent-admin/
RUN test -f /usr/share/nginx/html/ai-agent-admin/index.html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
+1
View File
@@ -0,0 +1 @@