feat: migrate web preview to Next.js
Verify mini program and deploy preview / verify-deploy (push) Successful in 3m30s

This commit is contained in:
2026-09-20 14:22:47 +08:00
parent 36aee09dfa
commit b5ee950142
40 changed files with 6897 additions and 1362 deletions
+18 -9
View File
@@ -1,14 +1,23 @@
FROM node:22-alpine AS dependencies
WORKDIR /app
COPY web/package.json web/package-lock.json ./
RUN npm ci
FROM node:22-alpine AS web-build
WORKDIR /app
COPY package.json package-lock.json vite.config.js ./
RUN npm ci
COPY web ./web
RUN npm run build:web
COPY --from=dependencies /app/node_modules ./node_modules
COPY web ./
COPY assets ./public/assets
RUN npm run build
FROM nginx:1.27-alpine
COPY --from=web-build /app/dist /usr/share/nginx/html
COPY assets /usr/share/nginx/html/assets
COPY nginx.conf /etc/nginx/conf.d/default.conf
FROM node:22-alpine AS runtime
WORKDIR /app
ENV NODE_ENV=production PORT=8080 HOSTNAME=0.0.0.0
RUN addgroup -S nextjs && adduser -S nextjs -G nextjs
COPY --from=web-build --chown=nextjs:nextjs /app/.next/standalone ./
COPY --from=web-build --chown=nextjs:nextjs /app/.next/static ./.next/static
COPY --from=web-build --chown=nextjs:nextjs /app/public ./public
USER nextjs
EXPOSE 8080
HEALTHCHECK --interval=10s --timeout=3s --start-period=5s --retries=5 CMD wget -q -O- http://127.0.0.1:8080/health || exit 1
CMD ["nginx", "-g", "daemon off;"]
CMD ["node", "server.js"]