Files
tehran_taj/DOCKER.md
s.esmaeiliandCursor 032fa800d9 fix(admin-panel): serve assets under /admin/ for same-host path deploy
Default Vite base to /admin/ (ADMIN_PANEL_BASE) so Dokploy Path+/admin + Strip Path resolves assets instead of the user app root.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-31 23:24:46 +03:30

2.1 KiB

Docker — copy-only deploy (Dokploy)

Build artifacts are produced on the developer machine and committed to git. Dokploy only builds thin images that copy those files (no pnpm install on the server).

One-time / before each deploy

pnpm install
pnpm build:release
git add -f apps/api/release apps/admin-panel/dist apps/user-app-v2/dist
git commit -m "chore: refresh release artifacts"
git push

What this produces:

App Artifact Image
API apps/api/release/app.js (+ Prisma under release/vendor) docker.arvancloud.ir/node:20-bookworm
Admin apps/admin-panel/dist/ docker.arvancloud.ir/nginx:latest
User apps/user-app-v2/dist/ docker.arvancloud.ir/nginx:latest

Dokploy Environment

POSTGRES_USER=goldbank
POSTGRES_PASSWORD=...
POSTGRES_DB=goldbank
EXTERNAL_DB_PORT=5433
DATABASE_URL=postgresql://goldbank:...@db:5432/goldbank?schema=public
PORT=3000

A second copy on the same server is a separate Dokploy application (its own domains, passwords, and JWT_SECRET). Do not set container_name in this file: those names are global in Docker, and a fixed goldbank_db collides with the first copy. Give the second app its own EXTERNAL_DB_PORT (for example 5434 if 5433 is already taken). Volumes stay separate because Dokploy uses a different Compose project name for each application.

Domains (container ports)

Same host (path-based) — default in this repo:

Service Path Port Notes
user-app-v2 / 80
admin-panel /admin 80 Strip Path on. Build with ADMIN_PANEL_BASE=/admin/ (default) so index.html links /admin/assets/….
api (optional) 3000

Or separate subdomains — set ADMIN_PANEL_BASE=/ before pnpm build:release:

Service Domain Port
admin-panel admin.example.com 80
user-app-v2 app.example.com 80
api (optional) 3000

Frontends call /api on their own domain; nginx proxies to api:3000.

Local compose smoke test

pnpm build:release
docker compose up --build -d