Build frontend locally for lightweight deployment

This commit is contained in:
wuyanwanwu
2026-08-13 23:44:50 +08:00
parent d8aaf63e05
commit 6037bde760
26 changed files with 242 additions and 18 deletions
+5 -15
View File
@@ -1,17 +1,7 @@
FROM node:22-alpine AS builder
FROM node:22-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --ignore-scripts
COPY . .
RUN npm run build
FROM node:22-alpine AS runner
WORKDIR /app
ENV NODE_ENV=production
ENV HOST=0.0.0.0
ENV PORT=3200
COPY --from=builder /app/package*.json ./
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/dist ./dist
ENV APP_PORT=3200
COPY deploy/server.mjs ./server.mjs
COPY out ./public
EXPOSE 3200
CMD ["npm", "run", "start", "--", "--hostname", "0.0.0.0", "--port", "3200"]
CMD ["node", "server.mjs"]