Fix prebuilt API boot: use bookworm and pass .env into container.
Alpine lacked OpenSSL so Prisma migrate hung and Nest never started; also restore env_file so GLOBAL_PREFIX and SMS settings reach the API. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+3
-3
@@ -1,7 +1,7 @@
|
|||||||
# ایمیج سبک: فرض میکند روی خود سرور قبلاً npm ci + build زدهای
|
# ایمیج prebuilt: dist و node_modules از قبل روی سرور هستند
|
||||||
# هیچ دانلودی داخل Docker انجام نمیشود (مناسب سرور ایران)
|
# bookworm تا OpenSSL برای Prisma آماده باشد (alpine این را ندارد)
|
||||||
|
|
||||||
FROM node:22-alpine
|
FROM node:22-bookworm
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
|
|||||||
@@ -26,23 +26,12 @@ services:
|
|||||||
depends_on:
|
depends_on:
|
||||||
postgres:
|
postgres:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
env_file:
|
||||||
|
- .env
|
||||||
environment:
|
environment:
|
||||||
|
# داخل شبکهٔ Docker باید به سرویس postgres وصل شود، نه localhost
|
||||||
DATABASE_URL: postgresql://${POSTGRES_USER:-fabric}:${POSTGRES_PASSWORD:-fabric123}@postgres:5432/${POSTGRES_DB:-fabric_trade}?schema=public
|
DATABASE_URL: postgresql://${POSTGRES_USER:-fabric}:${POSTGRES_PASSWORD:-fabric123}@postgres:5432/${POSTGRES_DB:-fabric_trade}?schema=public
|
||||||
JWT_SECRET: ${JWT_SECRET:?JWT_SECRET is required}
|
|
||||||
JWT_EXPIRES_IN: ${JWT_EXPIRES_IN:-7d}
|
|
||||||
PORT: 3000
|
PORT: 3000
|
||||||
MOCK_OTP_CODE: ${MOCK_OTP_CODE:-1234}
|
|
||||||
OTP_TTL_MINUTES: ${OTP_TTL_MINUTES:-5}
|
|
||||||
SMS_ENABLED: ${SMS_ENABLED:-true}
|
|
||||||
SMS_API_URL: ${SMS_API_URL:-http://185.231.112.101/api/createsms}
|
|
||||||
SMS_SECRET_KEY: ${SMS_SECRET_KEY:-}
|
|
||||||
SMS_PLATFORM: ${SMS_PLATFORM:-rayegansms}
|
|
||||||
SMS_HOST: ${SMS_HOST:-پارچه}
|
|
||||||
SMS_APP_NAME: ${SMS_APP_NAME:-پارچه}
|
|
||||||
BODY_LIMIT: ${BODY_LIMIT:-25mb}
|
|
||||||
TZ: ${TZ:-Asia/Tehran}
|
|
||||||
NODE_ENV: ${NODE_ENV:-production}
|
|
||||||
RUN_SEED: ${RUN_SEED:-false}
|
|
||||||
ports:
|
ports:
|
||||||
- '127.0.0.1:${API_PORT:-3000}:3000'
|
- '127.0.0.1:${API_PORT:-3000}:3000'
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user