fix: use pre-built frontend — skip build step on server

This commit is contained in:
Dorian
2026-03-17 03:39:37 +00:00
parent b514b05063
commit d88d3a0f74

View File

@@ -1,33 +1,8 @@
FROM node:22-alpine AS builder
WORKDIR /app
# Copy package files
COPY neode-ui/package*.json ./
# Install all dependencies (including dev)
RUN npm install
# Copy source code
COPY neode-ui/ ./
# Clean up backup files and large unused assets before build
RUN find public/assets -name "*backup*" -type f -delete || true && \
find public/assets -name "*1.47mb*" -type f -delete || true && \
find public/assets -name "bg-*.mp4" -type f -delete || true
# Build the Vue app (skip type checking, just build)
ENV DOCKER_BUILD=true
ENV NODE_ENV=production
# Use npm script which handles build better
RUN npm run build:docker || (echo "Build failed! Listing files:" && ls -la && echo "Checking vite config:" && cat vite.config.ts && exit 1)
# Production stage
# Pre-built frontend — no build step needed
FROM nginx:alpine
# Copy built files to nginx
COPY --from=builder /app/dist /usr/share/nginx/html
# Copy pre-built frontend
COPY neode-ui/dist /usr/share/nginx/html
# Copy AIUI pre-built dist
COPY demo/aiui/ /usr/share/nginx/html/aiui/
@@ -37,9 +12,6 @@ COPY neode-ui/docker/nginx-demo.conf /etc/nginx/nginx.conf.template
COPY neode-ui/docker/docker-entrypoint.sh /docker-entrypoint-custom.sh
RUN chmod +x /docker-entrypoint-custom.sh
# Expose port
EXPOSE 80
# Substitute ANTHROPIC_API_KEY at runtime, then start nginx
ENTRYPOINT ["/docker-entrypoint-custom.sh"]