2026-09-23 02:38:00 +03:30
|
|
|
# No `version:` key — it is obsolete in Compose v2 and only prints a warning on
|
|
|
|
|
# every command, which made the delivery checklist's output noisy.
|
2026-09-09 19:39:13 +03:30
|
|
|
services:
|
|
|
|
|
db:
|
2026-09-10 12:17:47 +03:30
|
|
|
image: docker.arvancloud.ir/postgres:15-alpine
|
2026-09-09 19:39:13 +03:30
|
|
|
container_name: goldbank_db
|
|
|
|
|
environment:
|
|
|
|
|
POSTGRES_USER: ${POSTGRES_USER:-postgres}
|
|
|
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
|
|
|
|
|
POSTGRES_DB: ${POSTGRES_DB:-goldbank}
|
|
|
|
|
ports:
|
2026-09-09 23:31:31 +03:30
|
|
|
- "${EXTERNAL_DB_PORT:-5432}:5432"
|
2026-09-09 19:39:13 +03:30
|
|
|
volumes:
|
|
|
|
|
- postgres_data:/var/lib/postgresql/data
|
|
|
|
|
restart: unless-stopped
|
2026-09-10 14:51:57 +03:30
|
|
|
healthcheck:
|
|
|
|
|
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres} -d ${POSTGRES_DB:-goldbank}"]
|
|
|
|
|
interval: 5s
|
|
|
|
|
timeout: 5s
|
|
|
|
|
retries: 12
|
2026-09-09 19:39:13 +03:30
|
|
|
|
|
|
|
|
api:
|
|
|
|
|
build:
|
2026-09-10 12:17:47 +03:30
|
|
|
context: ./apps/api
|
|
|
|
|
dockerfile: Dockerfile
|
2026-09-09 19:39:13 +03:30
|
|
|
container_name: goldbank_api
|
2026-09-10 14:51:57 +03:30
|
|
|
# Prisma connects on module init, so a not-yet-ready DB crash-loops the API.
|
2026-09-09 19:39:13 +03:30
|
|
|
depends_on:
|
2026-09-10 14:51:57 +03:30
|
|
|
db:
|
|
|
|
|
condition: service_healthy
|
2026-09-09 19:39:13 +03:30
|
|
|
environment:
|
|
|
|
|
- DATABASE_URL=${DATABASE_URL:-postgresql://postgres:postgres@db:5432/goldbank?schema=public}
|
|
|
|
|
- PORT=${PORT:-3000}
|
2026-09-23 00:30:09 +03:30
|
|
|
# Auth. Without these the API falls back to a well-known development
|
|
|
|
|
# secret, so set them in the deployment environment.
|
|
|
|
|
- JWT_SECRET=${JWT_SECRET:-}
|
|
|
|
|
- JWT_EXPIRES_IN=${JWT_EXPIRES_IN:-}
|
|
|
|
|
- JWT_CUSTOMER_SECRET=${JWT_CUSTOMER_SECRET:-}
|
|
|
|
|
- JWT_CUSTOMER_EXPIRES_IN=${JWT_CUSTOMER_EXPIRES_IN:-}
|
|
|
|
|
# ⚠ DELIVERY ONLY — a fixed OTP that signs in ANY active customer.
|
|
|
|
|
# Empty/unset disables it, which is the correct state for production.
|
|
|
|
|
# See ISSUES REL-01. Must be exactly 4 digits to be typable in the apps.
|
|
|
|
|
- OTP_MASTER_CODE=${OTP_MASTER_CODE:-}
|
|
|
|
|
# SMS. All blank = messages are logged, not sent; the API still boots (D20).
|
|
|
|
|
- SMS_PROVIDER=${SMS_PROVIDER:-}
|
|
|
|
|
- SMS_TREZ_URL=${SMS_TREZ_URL:-}
|
|
|
|
|
- SMS_TREZ_USERNAME=${SMS_TREZ_USERNAME:-}
|
|
|
|
|
- SMS_TREZ_PASSWORD=${SMS_TREZ_PASSWORD:-}
|
|
|
|
|
- SMS_TREZ_SENDER_LINE=${SMS_TREZ_SENDER_LINE:-}
|
2026-09-23 02:27:30 +03:30
|
|
|
# Admin mobiles told when a customer completes their profile (D22).
|
|
|
|
|
# Blank = nobody is notified; the upload still succeeds.
|
|
|
|
|
- PROFILE_ADMIN_MOBILES=${PROFILE_ADMIN_MOBILES:-}
|
2026-09-10 12:43:30 +03:30
|
|
|
# No host ports — Dokploy/Traefik routes by domain to container port 3000
|
|
|
|
|
expose:
|
|
|
|
|
- "3000"
|
2026-09-14 20:56:17 +03:30
|
|
|
# Uploaded files (product images, etc.) land in storage/uploads inside the
|
|
|
|
|
# container. Without a volume they vanish on every recreate/redeploy, and
|
|
|
|
|
# every UploadedFile/ProductImage row created before that would then point
|
|
|
|
|
# at a URL that 404s.
|
|
|
|
|
volumes:
|
|
|
|
|
- api_uploads:/app/storage/uploads
|
2026-09-09 19:39:13 +03:30
|
|
|
restart: unless-stopped
|
2026-09-10 14:59:25 +03:30
|
|
|
# The bare name "api" is ambiguous on Dokploy's shared network (other stacks
|
|
|
|
|
# register it too), which made nginx dial the wrong containers. Use a unique alias.
|
|
|
|
|
networks:
|
|
|
|
|
default:
|
|
|
|
|
aliases:
|
|
|
|
|
- goldbank-api
|
2026-09-09 19:39:13 +03:30
|
|
|
|
|
|
|
|
admin-panel:
|
|
|
|
|
build:
|
2026-09-10 12:17:47 +03:30
|
|
|
context: ./apps/admin-panel
|
|
|
|
|
dockerfile: Dockerfile
|
2026-09-09 19:39:13 +03:30
|
|
|
container_name: goldbank_admin_panel
|
2026-09-10 12:43:30 +03:30
|
|
|
# No host ports — Dokploy/Traefik routes by domain to container port 80
|
|
|
|
|
expose:
|
|
|
|
|
- "80"
|
2026-09-09 19:39:13 +03:30
|
|
|
restart: unless-stopped
|
|
|
|
|
depends_on:
|
|
|
|
|
- api
|
|
|
|
|
|
|
|
|
|
user-app:
|
|
|
|
|
build:
|
2026-09-10 12:17:47 +03:30
|
|
|
context: ./apps/user-app
|
|
|
|
|
dockerfile: Dockerfile
|
2026-09-09 19:39:13 +03:30
|
|
|
container_name: goldbank_user_app
|
2026-09-10 12:43:30 +03:30
|
|
|
# No host ports — Dokploy/Traefik routes by domain to container port 80
|
|
|
|
|
expose:
|
|
|
|
|
- "80"
|
2026-09-09 19:39:13 +03:30
|
|
|
restart: unless-stopped
|
|
|
|
|
depends_on:
|
|
|
|
|
- api
|
|
|
|
|
|
2026-09-18 17:16:36 +03:30
|
|
|
# Same copy-only nginx pattern as user-app; map a separate Dokploy domain to this service.
|
|
|
|
|
user-app-v2:
|
|
|
|
|
build:
|
|
|
|
|
context: ./apps/user-app-v2
|
|
|
|
|
dockerfile: Dockerfile
|
|
|
|
|
container_name: goldbank_user_app_v2
|
|
|
|
|
expose:
|
|
|
|
|
- "80"
|
|
|
|
|
restart: unless-stopped
|
|
|
|
|
depends_on:
|
|
|
|
|
- api
|
|
|
|
|
|
2026-09-09 19:39:13 +03:30
|
|
|
volumes:
|
|
|
|
|
postgres_data:
|
2026-09-14 20:56:17 +03:30
|
|
|
api_uploads:
|