admin
Some checks failed
Deploy Docker Image / build-and-deploy (push) Has been cancelled

This commit is contained in:
2026-02-27 17:35:49 +08:00
parent 5826f5ff86
commit c9ddf68e1c

View File

@@ -1,5 +1,4 @@
# Build Stage FROM node:18-alpine
FROM node:18-alpine as builder
WORKDIR /app WORKDIR /app
@@ -11,15 +10,11 @@ RUN npm ci
COPY . . COPY . .
RUN npm run build RUN npm run build
# Production Stage # Use a simple Node static server instead of nginx
FROM nginx:alpine RUN npm install -g serve
# Copy built assets from builder stage
COPY --from=builder /app/dist /usr/share/nginx/html
# Copy custom nginx config if needed (using default for now)
# COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80 EXPOSE 80
CMD ["nginx", "-g", "daemon off;"] # Serve the built SPA on port 80, with history fallback so /admin 等前端路由都可直接访问
CMD ["serve", "-s", "dist", "-l", "80"]