Assist_Design/apps/bff/scripts/docker-entrypoint.sh
barsa f4d4cb0ab0 Update pnpm-lock.yaml, Dockerfile, and environment configurations
- Added nestjs-pino dependency to pnpm-lock.yaml for improved logging capabilities.
- Updated Dockerfile to include a custom entrypoint script for better container management.
- Modified health controllers to include @Public() decorator for public access.
- Cleaned up environment variable samples for clarity and added new variables for Freebit integration.
- Adjusted Content Security Policy in next.config.mjs to allow inline scripts/styles for Next.js compatibility.
- Refactored ReissueSimModal to specify simType during eSIM reissue requests.
2025-12-01 15:30:04 +09:00

36 lines
1.3 KiB
Bash
Executable File

#!/bin/sh
set -e
# =============================================================================
# Docker Entrypoint Script
# =============================================================================
# Handles runtime setup before starting the application:
# - Decodes SF_PRIVATE_KEY_BASE64 to file if provided
# - Runs Prisma migrations if DATABASE_URL is set
# =============================================================================
echo "🚀 Starting Customer Portal Backend..."
# Handle Salesforce private key from base64 environment variable
if [ -n "$SF_PRIVATE_KEY_BASE64" ]; then
echo "📝 Decoding Salesforce private key..."
mkdir -p /app/secrets
echo "$SF_PRIVATE_KEY_BASE64" | base64 -d > /app/secrets/sf-private.key
chmod 600 /app/secrets/sf-private.key
export SF_PRIVATE_KEY_PATH=/app/secrets/sf-private.key
echo "✅ Salesforce private key configured"
fi
# Run database migrations if enabled
if [ "$RUN_MIGRATIONS" = "true" ] && [ -n "$DATABASE_URL" ]; then
echo "🗄️ Running database migrations..."
npx prisma migrate deploy --schema=/app/apps/bff/prisma/schema.prisma
echo "✅ Migrations complete"
fi
echo "🌐 Starting server on port ${PORT:-4000}..."
# Execute the main command (node dist/main.js)
exec "$@"