Files
fabric_trade_server/docker-compose.yml
T
mohmdsdgandCursor 5ed1b83457 Fix npm registry ARG so builds use npmmirror by default
ARG after FROM was empty without an explicit default, so npm ci hit the slow/blocked official registry.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-05 20:49:49 +03:30

45 lines
1.4 KiB
YAML

services:
postgres:
image: postgres:16-alpine
container_name: fabric_trade_db
restart: unless-stopped
environment:
POSTGRES_USER: ${POSTGRES_USER:-fabric}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-fabric123}
POSTGRES_DB: ${POSTGRES_DB:-fabric_trade}
ports:
- '${POSTGRES_PORT:-5432}:5432'
volumes:
- fabric_pg_data:/var/lib/postgresql/data
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB']
interval: 5s
timeout: 5s
retries: 10
api:
build:
context: .
dockerfile: Dockerfile
args:
NPM_REGISTRY: ${NPM_REGISTRY:-https://registry.npmmirror.com}
container_name: fabric_trade_api
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
environment:
DATABASE_URL: postgresql://${POSTGRES_USER:-fabric}:${POSTGRES_PASSWORD:-fabric123}@postgres:5432/${POSTGRES_DB:-fabric_trade}?schema=public
JWT_SECRET: ${JWT_SECRET:-fabric-trade-dev-secret-change-me}
JWT_EXPIRES_IN: ${JWT_EXPIRES_IN:-7d}
PORT: 3000
MOCK_OTP_CODE: ${MOCK_OTP_CODE:-123456}
OTP_TTL_MINUTES: ${OTP_TTL_MINUTES:-5}
RUN_SEED: ${RUN_SEED:-false}
ports:
# فقط روی localhost سرور اکسپوز شود؛ LiteSpeed به همین پورت پروکسی می‌زند
- '127.0.0.1:${API_PORT:-3000}:3000'
volumes:
fabric_pg_data: