# Tool_OCR Frontend Dockerfile # Multi-stage build for optimized image size # Stage 1: Build FROM node:20-alpine as builder WORKDIR /app # Copy package files COPY frontend/package*.json ./ # Install dependencies RUN npm ci # Copy source code COPY frontend/ ./ # Build application RUN npm run build # Stage 2: Production FROM nginx:alpine # Copy built files COPY --from=builder /app/dist /usr/share/nginx/html # Copy nginx configuration COPY deploy/1panel/nginx.conf /etc/nginx/conf.d/default.conf # Expose port EXPOSE 80 # Health check HEALTHCHECK --interval=30s --timeout=10s --retries=3 \ CMD curl -f http://localhost:80 || exit 1 # Run nginx CMD ["nginx", "-g", "daemon off;"]