Commit Graph

196 Commits

Author SHA1 Message Date
Ehsan.Asadi
12aba3df78 fix(docker): remove npm run build and fix PYTHONPATH | ApprovalToken: 1767140602
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
- Remove npm run build (reflex export already builds frontend)
- Fix PYTHONPATH ENV to avoid undefined variable warning
- Only install npm dependencies, don't run build script
- Fixes 'Missing script: build' error
2025-12-31 03:53:22 +03:30
Ehsan.Asadi
ad5c43087a fix(reflex): fix app module path and npm registry | ApprovalToken: 1767140333
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
- 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
2025-12-31 03:48:53 +03:30
Ehsan.Asadi
a5324456ec fix(docker): fix Reflex module path and npm registry | ApprovalToken: 1767140126
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
- 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
2025-12-31 03:45:27 +03:30
Ehsan.Asadi
293096ca13 fix(docker): handle missing package-lock.json in npm build | ApprovalToken: 1767139849
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
- Add conditional check for .web directory and package.json
- Fallback to npm install if package-lock.json doesn't exist
- Skip npm build gracefully if directory doesn't exist
- Fixes npm ci error when reflex export doesn't create lock file
2025-12-31 03:40:49 +03:30
Ehsan.Asadi
b9fbbe12ae fixe ci
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2025-12-31 03:35:11 +03:30
Ehsan.Asadi
97adff7c7e fixe ci
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2025-12-31 03:34:56 +03:30
Ehsan.Asadi
a5613d5d22 fixe ci
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2025-12-31 03:33:54 +03:30
Ehsan.Asadi
e49a077abd fixe ci
Some checks failed
ci/woodpecker/manual/woodpecker Pipeline was successful
ci/woodpecker/push/woodpecker Pipeline failed
2025-12-31 02:06:08 +03:30
Ehsan.Asadi
539011e3df fixe ci
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2025-12-31 01:55:47 +03:30
Ehsan.Asadi
61f6462cd8 fixe ci
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2025-12-31 01:52:27 +03:30
Ehsan.Asadi
8a0951a956 fixe ci
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2025-12-31 01:07:29 +03:30
Ehsan.Asadi
3537ba31ba fixe ci
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2025-12-31 01:03:24 +03:30
Ehsan.Asadi
ab93982675 fixe ci 2025-12-31 01:02:45 +03:30
Ehsan.Asadi
66e7985eb4 fixe ci
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2025-12-31 01:02:13 +03:30
Ehsan.Asadi
a26e948fde fixe ci
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2025-12-31 00:55:45 +03:30
Ehsan.Asadi
cec835e77b fixe ci
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2025-12-31 00:52:28 +03:30
Ehsan.Asadi
b16e45cdd6 fixe ci
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2025-12-31 00:48:59 +03:30
Ehsan.Asadi
a0a3258f3a fixe ci
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2025-12-31 00:30:54 +03:30
Ehsan.Asadi
38effdb6a9 fixe ci
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2025-12-31 00:20:21 +03:30
Ehsan.Asadi
d24a419aa0 fixe ci
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2025-12-31 00:16:50 +03:30
Ehsan.Asadi
b33b0da6ab fixe ci
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2025-12-31 00:12:26 +03:30
Ehsan.Asadi
bd89a7b680 fixe ci
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2025-12-31 00:12:07 +03:30
Ehsan.Asadi
c1f4f2a71a fix: remove timeout from step (not allowed in Woodpecker)
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Woodpecker doesn't support timeout at step level
It's a global or pipeline-level setting

Fixed linter errors!
2025-12-30 23:48:43 +03:30
Ehsan.Asadi
0347338a30 fixe ci
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2025-12-30 23:47:03 +03:30
Ehsan.Asadi
72c127f0c2 fixe ci
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2025-12-30 23:43:12 +03:30
Ehsan.Asadi
ec7f90b0de fixe ci
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
ci/woodpecker/manual/woodpecker Pipeline failed
2025-12-30 23:33:08 +03:30
Ehsan.Asadi
69deeea1a3 fixe ci
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2025-12-30 23:28:20 +03:30
Ehsan.Asadi
10aed88c23 fixe ci
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2025-12-30 23:26:14 +03:30
Ehsan.Asadi
d728bd30cc fix: disable provenance/sbom in base image stage like app stage
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
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!
2025-12-30 23:25:18 +03:30
Ehsan.Asadi
703c2c9bc7 fixe ci
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2025-12-30 23:21:34 +03:30
Ehsan.Asadi
fbd2f9845c fixe ci
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2025-12-30 23:20:34 +03:30
Ehsan.Asadi
c8f69caf06 fix: update Woodpecker CI syntax to new format
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Fixes:
 pipeline: → steps: (deprecated)
 secrets: → environment: with from_secret (deprecated)

Now compatible with latest Woodpecker!
2025-12-30 23:12:47 +03:30
Ehsan.Asadi
9b661d635e fixe ci
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2025-12-30 23:10:56 +03:30
Ehsan.Asadi
c4a478c20d fixe ci
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2025-12-30 23:06:51 +03:30
Ehsan.Asadi
2e96c28840 fixe ci
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2025-12-30 23:06:11 +03:30
Ehsan.Asadi
ed66aff5c0 fixe ci
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2025-12-30 23:03:11 +03:30
Ehsan.Asadi
3091de3e79 Merge feature/restructure-project into main
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Complete project restructure with base image strategy:

 Project Structure:
   • Root: Makefile, .gitignore, .woodpecker.yml
   • helm/: Kubernetes & ArgoCD configs
   • docker/: All Docker files (Dockerfile, Dockerfile.base)
   • peikarband/: Complete source code

 Base Image Strategy:
   • hub.peikarband.ir/peikarband/landing:base
   • Same repository, different tags
   • Faster builds (3 min vs 10 min)

 CI/CD:
   • Smart pipeline with base image management
   • Auto-build on changes
   • Harbor registry integration

 Documentation:
   • Complete Makefile with help
   • Quick start guide
   • All commands documented
2025-12-30 22:51:37 +03:30
Ehsan.Asadi
f19f60015b feat: improve Makefile help with base image commands
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
ci/woodpecker/manual/woodpecker Pipeline failed
Added:
 Better formatting with emojis
 Base image commands section
 Quick start guide
 Grouped commands logically

Run 'make help' to see all commands!
2025-12-30 22:46:01 +03:30
Ehsan.Asadi
3e3d396409 fix: update Makefile to use correct base image tag
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
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!
2025-12-30 22:44:49 +03:30
Ehsan.Asadi
cf6fcd4dfe fix: use same repo for base image with different tag
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
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!
2025-12-30 22:42:34 +03:30
Ehsan.Asadi
15e664461d fix: build base image in same repo with different tag
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}
2025-12-30 22:41:14 +03:30
Ehsan.Asadi
8253fa73de feat: add base image build/push commands to Makefile
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
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
2025-12-30 22:39:04 +03:30
Ehsan.Asadi
fdfca1c4f1 fix: disable provenance and sbom for Harbor compatibility
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
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!
2025-12-30 22:29:14 +03:30
Ehsan.Asadi
a608726db9 fixe ci
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2025-12-30 22:26:23 +03:30
Ehsan.Asadi
6fe58c3815 feat: add smart base image management to pipeline
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
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!
2025-12-30 22:21:17 +03:30
Ehsan.Asadi
826447e9a2 feat: add tini to base image
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
ci/woodpecker/manual/woodpecker Pipeline was successful
Now base image includes:
 Python 3.11
 Node.js 20
 bun, npm
 Build tools (gcc, g++, make)
 Runtime essentials (curl, ca-certificates, git)
 tini (init system)

Runtime Dockerfile needs ZERO apt installs!
2025-12-30 22:17:13 +03:30
Ehsan.Asadi
7c1b8b90ba feat: move tini to base image
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
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 🚀
2025-12-30 22:16:31 +03:30
Ehsan.Asadi
82af967dfc fix: runtime stage also uses base image
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
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!
2025-12-30 22:15:19 +03:30
Ehsan.Asadi
8766103637 feat: use base image for faster builds
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!
2025-12-30 22:14:40 +03:30
Ehsan.Asadi
cb64fa1da2 fix: simplify pipeline - build app with self-contained Dockerfile
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
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
2025-12-30 22:10:55 +03:30