No description
- TypeScript 94.1%
- Shell 3.5%
- JavaScript 1.7%
- CSS 0.6%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| backend | ||
| docs | ||
| scripts | ||
| storefront | ||
| .dockerignore | ||
| .gitignore | ||
| coolify.env.example | ||
| docker-compose.dev.override.yml | ||
| docker-compose.dev.prod.yml | ||
| docker-compose.dev.yml | ||
| docker-compose.yml | ||
| example.env | ||
| Jenkinsfile | ||
| LICENSE | ||
| Makefile | ||
| README.md | ||
Production Medusa v2 on Coolify
Custom Docker images and Compose stack for Medusa e-commerce with a Next.js storefront.
Repository: https://git.aexoradao.com/epistemophiliac/medusa
Architecture (why Jenkins ≠ storefront)
| Component | Built where | Why |
|---|---|---|
| Backend | Jenkins → Forgejo :main |
No public URL needed at build time (like ERPNext) |
| Storefront | Coolify at deploy | NEXT_PUBLIC_* URLs are baked into Next.js at docker build — Coolify knows your domains via SERVICE_URL_* |
Stack
| Service | Port | Role |
|---|---|---|
storefront |
8000 | Next.js shop (COMPOSE_PROFILES=shop) |
backend |
9000 | API + admin at /app |
worker |
— | Background jobs |
postgres / redis |
— | Data layer |
Pipeline (Jenkins)
- Validate compose + readiness
- Build backend only (
backend/Dockerfile.prod) - Push
git.aexoradao.com/epistemophiliac/medusa-backend:main - Archive
dist/coolify-image.env
See docs/JENKINS.md.
Coolify deploy (two phases)
Phase 1 — backend: Deploy without COMPOSE_PROFILES. Assign domain on backend:9000. Set secrets + CORS from coolify.env.example.
Phase 2 — shop: Set COMPOSE_PROFILES=shop, NEXT_PUBLIC_MEDUSA_BACKEND_URL (same as SERVICE_URL_BACKEND_9000), NEXT_PUBLIC_BASE_URL, publishable key. Assign domain on storefront:8000. Redeploy — Coolify builds the storefront with the live API reachable on the internal network.
Local development
cp backend/.env.template backend/.env
cp storefront/.env.template storefront/.env
docker compose -f docker-compose.dev.yml up --build
Local CI
make ci
BUILD_IMAGE=1 bash scripts/ci/jenkins-run.sh