fix: use pre-built frontend — skip build step on server
This commit is contained in:
@@ -1,33 +1,8 @@
|
|||||||
FROM node:22-alpine AS builder
|
# Pre-built frontend — no build step needed
|
||||||
|
|
||||||
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
|
|
||||||
FROM nginx:alpine
|
FROM nginx:alpine
|
||||||
|
|
||||||
# Copy built files to nginx
|
# Copy pre-built frontend
|
||||||
COPY --from=builder /app/dist /usr/share/nginx/html
|
COPY neode-ui/dist /usr/share/nginx/html
|
||||||
|
|
||||||
# Copy AIUI pre-built dist
|
# Copy AIUI pre-built dist
|
||||||
COPY demo/aiui/ /usr/share/nginx/html/aiui/
|
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
|
COPY neode-ui/docker/docker-entrypoint.sh /docker-entrypoint-custom.sh
|
||||||
RUN chmod +x /docker-entrypoint-custom.sh
|
RUN chmod +x /docker-entrypoint-custom.sh
|
||||||
|
|
||||||
|
|
||||||
# Expose port
|
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|
||||||
# Substitute ANTHROPIC_API_KEY at runtime, then start nginx
|
|
||||||
ENTRYPOINT ["/docker-entrypoint-custom.sh"]
|
ENTRYPOINT ["/docker-entrypoint-custom.sh"]
|
||||||
|
|||||||
Reference in New Issue
Block a user