FROM node:18-alpine WORKDIR /app RUN npm config set registry https://registry.npmmirror.com COPY package*.json ./ RUN npm ci COPY . . RUN npm run build # Use a simple Node static server instead of nginx RUN npm install -g serve EXPOSE 80 # Serve the built SPA on port 80, with history fallback so /admin 等前端路由都可直接访问 CMD ["serve", "-s", "dist", "-l", "80"]