mirror of
https://github.com/R0m1k3/Regisflow.git
synced 2026-10-11 17:29:48 +02:00
Refactors Dockerfile and entrypoint script for enhanced reliability and Node.js 18 compatibility, including database migration. Replit-Commit-Author: Agent Replit-Commit-Session-Id: dec54137-d5a2-4406-8ad4-5f2f9fb110bf Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/0715008c-7244-40f4-befc-26c014852236/5d315300-98fa-429a-abb0-4fdce6a2e3c9.jpg
34 lines
923 B
JavaScript
34 lines
923 B
JavaScript
// Production startup script for Node.js 18 compatibility
|
|
// Fixes import.meta.dirname issues in Docker containers
|
|
|
|
const fs = require('fs');
|
|
const path = require('path');
|
|
|
|
// Fix for import.meta.dirname in Node.js 18
|
|
const distPath = path.join(__dirname, '../dist/index.js');
|
|
|
|
if (fs.existsSync(distPath)) {
|
|
console.log('🔧 Applying Node.js 18 compatibility fixes...');
|
|
|
|
let content = fs.readFileSync(distPath, 'utf8');
|
|
|
|
// Replace import.meta.dirname with static path
|
|
content = content.replace(
|
|
/import\.meta\.dirname/g,
|
|
'"/app"'
|
|
);
|
|
|
|
// Replace import.meta.url references if any
|
|
content = content.replace(
|
|
/import\.meta\.url/g,
|
|
'"file:///app"'
|
|
);
|
|
|
|
fs.writeFileSync(distPath, content);
|
|
console.log('✅ Compatibility fixes applied');
|
|
} else {
|
|
console.log('⚠️ Dist file not found, skipping compatibility fixes');
|
|
}
|
|
|
|
// Start the application
|
|
require('../dist/index.js'); |