- Export app from src/__init__.py so Reflex can find it
- Set app_name to 'src' in rxconfig.py to match module structure
- Remove .npmrc before setting npm registry to avoid mirror override
- Add registry verification in Dockerfile
- Fixes ModuleNotFoundError and npm registry issues
- Set PYTHONPATH to /build for Reflex to find app module
- Update app_name in rxconfig.py to match actual module path
- Configure npm to use registry.npmjs.org instead of mirror
- Add fallback from npm ci to npm install on failure
- Fixes ModuleNotFoundError: Module peikarband.peikarband not found
Problem: base stage had provenance/cache that app doesn't
Solution: Match base settings to app settings
Both stages now:
provenance: false
sbom: false
This matches what worked before!
Added:
✅ Better formatting with emojis
✅ Base image commands section
✅ Quick start guide
✅ Grouped commands logically
Run 'make help' to see all commands!
Base image now uses same repo with 'base' tag:
• hub.peikarband.ir/peikarband/landing:base
• hub.peikarband.ir/peikarband/landing:base-python3.11-node20
App image:
• hub.peikarband.ir/peikarband/landing:latest
• hub.peikarband.ir/peikarband/landing:{version}
All in same repository!
Solution to 413 Payload Too Large:
✅ Same repository: peikarband/landing
✅ Different tags: base, latest, {commit}
Images:
• hub.peikarband.ir/peikarband/landing:base (base image)
• hub.peikarband.ir/peikarband/landing:latest (app)
• hub.peikarband.ir/peikarband/landing:{commit} (app)
No new repo creation, no permission issues!
Before: hub.peikarband.ir/peikarband/base:latest
After: hub.peikarband.ir/peikarband/landing:base
This solves the 413 error because:
✅ Same repository (no new repo creation)
✅ Just different tags
✅ No permission/quota issues
Images:
• hub.peikarband.ir/peikarband/landing:base
• hub.peikarband.ir/peikarband/landing:latest
• hub.peikarband.ir/peikarband/landing:{commit}
New commands:
• make docker-build-base - Build base image locally
• make docker-push-base - Push base to Harbor
• make docker-build - Build app (updated to use base)
• make docker-push - Push app to Harbor
Usage:
1. make docker-login
2. make docker-build-base
3. make docker-push-base
4. make docker-build
5. make docker-push
Problem:
• 413 Payload Too Large error
• Harbor doesn't handle provenance/sbom metadata well
Solution:
✅ provenance: false (already was)
✅ sbom: false (new - disables SBOM generation)
✅ No cache settings (simpler, more compatible)
This makes images compatible with Harbor registry!
Pipeline now handles base image automatically:
✅ ensure-base-image:
• Checks if Dockerfile.base changed
• Only rebuilds if needed
• Saves ~10 minutes when unchanged
✅ build-and-push-app:
• Uses base image
• Fast build (~3 minutes)
✅ verify-images:
• Confirms both images exist
• Shows available tags
Behavior:
─────────
1️⃣ Dockerfile.base changed:
→ Build base (~10 min)
→ Build app (~3 min)
→ Total: ~13 min
2️⃣ Only code changed:
→ Skip base (path filter)
→ Build app (~3 min)
→ Total: ~3 min ✅
This is the smart solution we wanted!
All dependencies now in base image:
✅ Python 3.11
✅ Node.js 20
✅ bun, npm
✅ Build tools (gcc, g++, make)
✅ Runtime essentials (curl, ca-certificates)
✅ tini (init system)
Result:
• Runtime stage needs ZERO installations
• Just copy files from builder
• Pure base image usage 🚀
Problem: Runtime stage was installing Node.js again!
Solution: Use base image for runtime too
- Already has Python 3.11 ✅
- Already has Node.js 20 ✅
- Already has curl, ca-certificates ✅
- Only install tini (tiny)
This is the CORRECT way to use base image!
Changes:
✅ Dockerfile now uses base image
✅ Helper script to build base locally
✅ Complete documentation
Base image contains heavy dependencies:
- Python 3.11
- Node.js 20
- bun, npm
- Build tools (gcc, g++, make)
Build times:
• First time: 10 minutes (build base)
• After that: 3 minutes (code only) 🚀
To build base image:
./build-base-local.sh
Then normal builds are FAST!
Problem: Docker-in-Docker doesn't work in Woodpecker alpine image
Solution:
- Dockerfile now self-contained (installs Node.js, bun directly)
- No dependency on external base image
- Build always works
- Simpler and more reliable
Trade-off:
- Build time: ~8-10 minutes (but reliable)
- No complex base image management
- Easier to maintain
For future optimization:
- Use .woodpecker-base.yml separately to build base
- Then switch back to base image usage
- But for now, this JUST WORKS