Skip to content
This repository was archived by the owner on Aug 7, 2026. It is now read-only.

Latest commit

 

History

History
162 lines (117 loc) · 3.7 KB

File metadata and controls

162 lines (117 loc) · 3.7 KB

🚀 Deployment Image Size Fix

Problem

Deployment failed: Image size exceeds 8 GiB limit for Autoscale (Cloud Run)

✅ Fixes Applied

1. Enhanced .dockerignore ✓

Added exclusions for:

  • infrastructure/ - Development-only files
  • agents/ - Trinity Symphony agent scripts (not needed in production)
  • attached_assets/ - User uploads and test files
  • .cursor/ - IDE files

2. Manual Fixes Required

A. Clean Up .replit File (CRITICAL)

Your .replit file has 16 excessive port configurations causing bloat.

Action Required: Edit .replit and remove lines 18-77:

Before (lines 14-77):

[[ports]]
localPort = 5000
externalPort = 80

[[ports]]
localPort = 24678
externalPort = 6000
# ... (14 more port configs) ...

After (keep ONLY this):

[[ports]]
localPort = 5000
externalPort = 80

How to fix:

  1. Open .replit file
  2. Delete lines 18-77 (all the extra port configs)
  3. Keep only the first port configuration (5000 → 80)

Alternative: Switch to Reserved VM

If you need all the current features and can't reduce image size below 8 GiB:

Steps to Switch Deployment Type:

  1. Go to Deployments pane in Replit
  2. Click Configuration tab
  3. Change deployment type from Autoscale to Reserved VM
  4. Reserved VM supports larger images (no 8 GiB limit)

Trade-offs:

  • ✅ Supports larger applications
  • ✅ More consistent performance
  • ❌ Slightly higher cost
  • ❌ No auto-scaling

Additional Optimization (Optional)

Remove Unused Dependencies

Your project has many packages. Consider removing unused ones:

Large packages that might not be needed:

  • torch (Python) - Machine learning library (very large)
  • Multiple blockchain SDKs if not all are used
  • Duplicate AI provider packages

Check what's installed:

npm list --depth=0 | grep -v deduped | wc -l

Remove unused packages:

npm uninstall package-name

Recommended Path Forward

Option 1: Minimize Image (Recommended)

  1. ✅ Enhanced .dockerignore (DONE)
  2. Clean up .replit (remove 15 extra ports)
  3. Try deployment again
  4. If still too large, remove unused npm packages

Option 2: Use Reserved VM

  1. Go to Deployments → Configuration
  2. Switch from Autoscale to Reserved VM
  3. Deploy without size limits

Files Excluded from Deployment

The updated .dockerignore now excludes:

Development Files:

  • infrastructure/ - Patent docs, HDM manifests
  • agents/ - Trinity Symphony scripts (HDM, APM, MEL)
  • attached_assets/ - User uploads
  • .cursor/ - IDE files
  • All .md files except README.md
  • Test files (*.test.ts, *.spec.js)

Build Artifacts:

  • node_modules/ - Rebuilt during deployment
  • dist/, build/, .next/
  • Cache directories
  • Log files

Total Estimated Savings: ~2-4 GiB from excluded directories


Deployment Build Process

Your deployment runs:

npm run build  # Builds production assets
npm run start  # Starts production server

Make sure these scripts in package.json only include production deps.


Testing Locally

Simulate deployment size:

# Check what WILL be deployed
tar --exclude-from=.dockerignore -czf deployment-test.tar.gz .
du -sh deployment-test.tar.gz
rm deployment-test.tar.gz

If output is < 2 GiB compressed, deployment should succeed.


Need Help?

If deployment still fails after fixes:

  1. Check Deployment logs for specific errors
  2. Run: du -sh infrastructure/ agents/ attached_assets/ to verify exclusions
  3. Consider switching to Reserved VM deployment type

Contact Replit Support if issues persist:

  • Deployments pane → Help → Contact Support
  • Mention: "Image size exceeds 8 GiB on Autoscale deployment"