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 as builder
FROM node:18-alpine
WORKDIR /app
@@ -11,15 +10,11 @@ RUN npm ci
COPY . .
RUN npm run build
# Production Stage
FROM nginx:alpine
# 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
# Use a simple Node static server instead of nginx
RUN npm install -g serve
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"]