# Simple production Dockerfile for Hugging Face Spaces FROM node:20-alpine # Install basic dependencies (including git for HF Spaces) RUN apk add --no-cache curl wget git dumb-init # Create app directory WORKDIR /app # Copy package files COPY package*.json ./ COPY backend/package*.json ./backend/ COPY frontend/package*.json ./frontend/ # Install backend dependencies WORKDIR /app/backend RUN npm ci --only=production --silent # Install frontend dependencies and build WORKDIR /app/frontend RUN npm ci --silent COPY frontend/ ./ RUN DISABLE_ESLINT_PLUGIN=true GENERATE_SOURCEMAP=false TSC_COMPILE_ON_ERROR=true npm run build # Setup production files WORKDIR /app COPY backend/ ./backend/ COPY --from=0 /app/frontend/build ./backend/public/ # Set environment ENV NODE_ENV=production \ PORT=7860 \ USE_LOCAL_AI=true \ USE_HUGGINGFACE=false \ USE_OPENAI=false # Expose port EXPOSE 7860 # Health check HEALTHCHECK --interval=30s --timeout=10s --start-period=10s --retries=3 \ CMD curl -f http://localhost:7860/health || exit 1 # Start application CMD ["node", "backend/server.js"]