Coolify v4 Production Deployment Guide
Step-by-step production deployment guide for B2BExpo by YPYM (@tradeos/web) to Coolify under the subdomain b2bexpo.ypym.app.
B2BExpo Production Deployment Guide (Coolify v4)
This guide provides exact configuration steps to deploy the B2BExpo by YPYM web application (@tradeos/web) to your Coolify VPS instance under the target subdomain https://b2bexpo.ypym.app.
1. Architecture & Multi-Pack Compatibility
B2BExpo is structured as a high-performance pnpm monorepo managed with Turborepo. The web application (apps/web) depends on internal workspace packages (@tradeos/types, @tradeos/commerce-core, @tradeos/trade-compliance, etc.).
To ensure deterministic, zero-failure deployment in Coolify v4, the repository provides multi-strategy support:
| Strategy | Status | Config File | Description |
|---|---|---|---|
| Dockerfile (Recommended) | First Class | Dockerfile | Multi-stage Alpine container with explicit corepack pnpm v10.33.0, building @tradeos/web... |
| Railpack | Supported | package.json | Uses root scripts build and start tailored for @tradeos/web |
| Nixpacks | Supported | nixpacks.toml | Declares Node.js 20, corepack pnpm activation, and frozen-lockfile build |
2. DNS Record Setup (Cloudflare / Namecheap / DNS Provider)
Before or immediately after deploying, configure the DNS A-Record for your custom domain:
| Type | Name / Host | Target / Value | Proxy Status | TTL |
|---|---|---|---|---|
| A | b2bexpo | <YOUR_SERVER_IP> | DNS Only (or Proxied) | Auto / 300s |
Note: Replace
<YOUR_SERVER_IP>with the public IP address of your Coolify server shown in your Coolify dashboard under Infrastructure > Servers.
3. Coolify UI Configuration Steps
Following your screen in Coolify (YPYM Dev / YPYM Venture / production):
Step A: Initial Repository & Build Configuration
On the New Resource screen:
- Repository:
maarif88/ypym-venture - Branch:
main - Build pack: Select
Dockerfile(or leave asRailpack) - Output type:
Web application - Port:
3000 - Base directory:
/ - Click the purple Continue button.
Step B: General Settings & Domain (FQDN)
Once the application is created:
- Navigate to the General tab.
- In the Domains field, input:
https://b2bexpo.ypym.app - Coolify's built-in Traefik reverse proxy will automatically acquire a valid Let's Encrypt SSL Certificate once the DNS A record resolves to your server.
Step C: Environment Variables (Optional / Recommended)
In the Environment Variables tab:
NODE_ENV=production
PORT=3000
HOSTNAME=0.0.0.0
DATA_DIR=/app/data
TWENTY_CRM_API_URL=https://crm.ypym.app/rest
TWENTY_CRM_API_KEY=your_production_twenty_api_key_hereStep D: Persistent Volume (Preserve Database Across Redeploys)
To ensure user accounts, registrations, invites, and trade transactions persist across container redeployments:
- Go to the Storages tab in your application settings.
- Add a new Persistent Storage:
- Source Path (Host):
ypym-b2bexpo-data(or/var/lib/coolify/volumes/tradeos-data) - Destination Path (Container):
/app/data
- Source Path (Host):
- Click Save.
Step E: Trigger Deployment
- Click the Deploy button in the top right corner.
- View real-time build logs. Turborepo will compile all 45 routes and output:
✓ Compiled successfully ✓ Generating static pages (45/45) Listening on port 3000 - Open
https://b2bexpo.ypym.appto verify live production.
4. Verification Checklist
- Domain resolves to Coolify server IP:
nslookup b2bexpo.ypym.app - HTTPS padlock is green and valid (Let's Encrypt)
- Navigation and auth routes (
/auth/login,/auth/register,/auth/invite) function cleanly - Exporter registration creates atomic store entry
- Seller team management (
/seller#team) invites and displays memberships - Deal room and Escrow simulator (
/deal-room/DR-2026-9041) responds smoothly
Autentikasi Nyata & Multi-Tenant RBAC
Arsitektur keamanan autentikasi produksi, kontrol akses berbasis peran (RBAC), multi-tenant data isolation, dan sinkronisasi otomatis Twenty CRM di B2BExpo.
Master Design System & Brand DNA
Public Repository Blueprint, 3-5% Calibrated Amazon Palette, Universal Tokens & Component Library