🔧 Container Interface Deployment Fix:
- Use nginx.deploy.conf for deployment-specific nginx config
- Add command to copy client files to shared volume
- Improve startup logging and error handling
- Ensure client files are available to nginx container
✅ Deployment Ready:
- Works with Portainer, Docker Desktop, and similar interfaces
- Copies React build files from API container to nginx volume
- Proper container startup sequence and health checks
- Clear logging for troubleshooting startup issues
This fixes the missing client files issue when deploying from container management interfaces.
🔧 Critical Fix:
- Remove --only=production from client build stage (needs devDependencies)
- Remove --only=production from server build stage (needs TypeScript, etc.)
- Add production dependencies install in final stage only
- Remove duplicate npm ci commands
🏗️ Build Process Fixed:
- Client: npm ci (all deps) → build with TypeScript/Vite → copy dist/
- Server: npm ci (all deps) → build with TypeScript → copy dist/
- Production: Install only runtime dependencies for final image
⚡ Why This Fixes It:
- Build tools (TypeScript, Vite) are devDependencies
- --only=production excludes build tools, causing 'npm run build' to fail
- Final production stage still gets minimal runtime dependencies
This should resolve the 'npm run build exit code 127' Docker build error.
Architecture Updates:
- Nginx serves static React files for optimal performance
- Nginx proxies API requests to Node.js backend (port 8080)
- Separation of concerns: static files vs API handling
- Professional production setup with proper caching
Features Added:
- nginx.conf with optimized configuration:
- Static file serving with long-term caching
- API reverse proxy with rate limiting
- Security headers and GZIP compression
- Health check proxying and SPA routing support
- Updated docker-compose.yml for multi-container setup
- build-deploy.sh script for automated deployment
- Updated environment configuration for container networking
Security & Performance:
- Rate limiting on API and auth endpoints
- Security headers (XSS, CSRF, clickjacking protection)
- GZIP compression for static assets
- Proper cache control headers
- Container-to-container communication
Deployment:
- Single command deployment with ./build-deploy.sh
- Nginx on port 80 (exposed as 3000) serving React app
- API server on internal port 8080 (not exposed)
- Persistent data volume mounting for business files
Features:
- Multi-stage Dockerfile for optimized production builds
- Docker Compose configuration with health checks
- Health check endpoint for container monitoring
- Production environment configuration template
- Comprehensive deployment guide for Mac Mini
- Docker ignore file for efficient build context
- Security: Non-root user, proper signal handling
- Persistence: Data directory volume mounting
- Performance: Alpine Linux base, optimized layers
- Future-ready: MongoDB service configuration (commented)
Deployment:
- Simple 'docker-compose up' deployment
- Automatic health monitoring and restart policies
- Persistent data storage with volume mounts
- Port configuration and environment customization
- Complete troubleshooting and management guide
- Create secure data/ directory structure for local business files
- Add comprehensive data organization guide with security notes
- Move all sensitive files to protected data/ directory
- Enhanced .gitignore to exclude entire data/ directory (except README)
- Provide clear instructions for local data file management
- Ensure no business data can accidentally be committed to public repo
- Remove Excel business tracker spreadsheet from git tracking
- Enhanced .gitignore to exclude all business documents:
- CSV files, Excel files, PDF documents
- Transaction statements and business trackers
- Preserve essential config files (package.json, tsconfig, etc.)
- Protect sensitive financial and customer data from public exposure
Features:
- React + TypeScript frontend with Tailwind CSS
- Node.js + Express backend with TypeScript
- Comprehensive order tracking and management
- Product catalog with inventory tracking
- Customer data management
- Expense tracking and categorization
- Advanced Profit Analysis Dashboard with:
- Real-time profit metrics and KPI visualization
- Detailed order-level profit breakdown
- Product performance analysis
- Enhanced time range filtering (monthly, quarterly, yearly)
- Interactive expandable order analysis
- Performance categorization and color coding
- CSV import functionality for Etsy statements
- PDF parsing capabilities
- Redux state management with persistence
- Responsive design with mobile support
- Australian date formatting and currency display