Compare commits

...
2 Commits
Author SHA1 Message Date
andy 14e020b781 Merge remote-tracking branch 'origin/main' 2026-08-27 15:48:35 +08:00
andy 3d997e2613 部署增加脚本 2026-08-27 15:48:14 +08:00
5 changed files with 85 additions and 2 deletions

No files matched your search

Vendored
+1 -1
View File
@@ -124,7 +124,7 @@ pipeline {
docker build \
--build-arg "VITE_API_BASE_URL=$ADMIN_API_BASE_URL" \
--tag "$ADMIN_IMAGE:$IMAGE_TAG" \
WonderQ-Admin-UI
WonderQ-Admin-UI-Vue
docker run --rm \
--entrypoint nginx \
+9
View File
@@ -0,0 +1,9 @@
node_modules/
dist/
.git/
.idea/
.env
.env.*
coverage/
.vite/
*.log
+28
View File
@@ -0,0 +1,28 @@
# syntax=docker/dockerfile:1
FROM node:22-bookworm-slim AS build
WORKDIR /app
COPY package.json yarn.lock ./
# The lock file contains Windows native packages for local development and
# their Linux counterparts for the container build.
RUN yarn install --frozen-lockfile --non-interactive --ignore-platform
COPY . .
ARG VITE_API_BASE_URL=""
ENV VITE_API_BASE_URL="${VITE_API_BASE_URL}"
RUN yarn build
FROM nginx:1.28-alpine AS runtime
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=build /app/dist /usr/share/nginx/html/admin
EXPOSE 80
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD wget -q -O /dev/null http://127.0.0.1/healthz || exit 1
+46
View File
@@ -0,0 +1,46 @@
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
root /usr/share/nginx/html;
index index.html;
charset utf-8;
server_tokens off;
add_header X-Content-Type-Options "nosniff" always;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
gzip on;
gzip_min_length 1024;
gzip_types text/css application/javascript application/json image/svg+xml;
location = /healthz {
access_log off;
default_type text/plain;
return 200 "ok\n";
}
location = / {
return 302 /admin/;
}
location = /admin {
return 301 /admin/;
}
location = /admin/index.html {
expires -1;
try_files $uri =404;
}
location /admin/assets/ {
expires 1y;
try_files $uri =404;
}
location /admin/ {
try_files $uri $uri/ /admin/index.html;
}
}
+1 -1
View File
@@ -89,7 +89,7 @@ log "构建 Admin UI 镜像:$ADMIN_IMAGE:$IMAGE_TAG"
docker build \
--build-arg "VITE_API_BASE_URL=$ADMIN_API_BASE_URL" \
--tag "$ADMIN_IMAGE:$IMAGE_TAG" \
WonderQ-Admin-UI
WonderQ-Admin-UI-Vue
log "检查 Admin UI Nginx 配置"
docker run --rm \