stuff
This commit is contained in:
parent
44b0e1e73a
commit
446dfaad3c
2 changed files with 27 additions and 12 deletions
|
|
@ -15,4 +15,6 @@ RUN npm ci --production
|
|||
COPY --from=builder /app/dist ./dist
|
||||
COPY --from=builder /app/node_modules/.prisma ./node_modules/.prisma
|
||||
EXPOSE 3000
|
||||
CMD ["sh", "-c", "npx prisma migrate deploy && node dist/main"]
|
||||
|
||||
# Используем shell для лучшего логирования ошибок
|
||||
CMD sh -c "echo '=== Starting Backend ===' && npx prisma migrate deploy && echo '=== Migrations completed ===' && node dist/main"
|
||||
|
|
|
|||
|
|
@ -55,6 +55,8 @@ async function bootstrap() {
|
|||
|
||||
const port = configService.get<number>('PORT') || 3000;
|
||||
const host = configService.get<string>('HOST') || '0.0.0.0';
|
||||
|
||||
try {
|
||||
await app.listen(port, host);
|
||||
console.log(`=== Backend Started Successfully ===`);
|
||||
console.log(`Backend running on http://${host}:${port}`);
|
||||
|
|
@ -65,5 +67,16 @@ async function bootstrap() {
|
|||
console.log(` - PORT: ${port}`);
|
||||
console.log(` - HOST: ${host}`);
|
||||
console.log(` - CORS_ORIGIN: ${corsOrigin}`);
|
||||
} catch (error) {
|
||||
console.error(`=== Backend Failed to Start ===`);
|
||||
console.error(`Error: ${error.message}`);
|
||||
console.error(error);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
bootstrap();
|
||||
|
||||
bootstrap().catch((error) => {
|
||||
console.error('=== Fatal Error During Bootstrap ===');
|
||||
console.error(error);
|
||||
process.exit(1);
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue