Dockerfile.frontend 565 B

123456789101112131415161718192021222324252627
  1. FROM node:22-alpine
  2. WORKDIR /opt/maxkb-app/ui
  3. COPY ui/package.json ./
  4. RUN npm config set registry https://registry.npmmirror.com && \
  5. npm install
  6. COPY ui/ ./
  7. ENV NODE_OPTIONS="--max-old-space-size=4096"
  8. RUN npm run build-only -- --mode admin && \
  9. mv dist dist_admin && \
  10. npm run build-only-chat -- --mode chat && \
  11. cp -r dist_admin/* dist/ && \
  12. rm -rf dist_admin
  13. FROM nginx:alpine
  14. COPY --from=0 /opt/maxkb-app/ui/dist /usr/share/nginx/html
  15. COPY ui/nginx.conf /etc/nginx/conf.d/default.conf
  16. EXPOSE 80
  17. CMD ["nginx", "-g", "daemon off;"]