fix some for api container

This commit is contained in:
mahmood
2026-09-11 00:00:36 +03:30
parent 18415d50c6
commit 13c8eda4b2
7 changed files with 65 additions and 10 deletions
+3 -3
View File
@@ -219153,9 +219153,9 @@ async function bootstrap() {
const document2 = swagger_1.SwaggerModule.createDocument(app, swaggerConfig);
swagger_1.SwaggerModule.setup("api/docs", app, document2);
const port = configService.get("PORT", 3e3);
await app.listen(port);
console.log(`Application is running on: http://localhost:${port}`);
console.log(`Swagger documentation: http://localhost:${port}/api/docs`);
await app.listen(port, "0.0.0.0");
console.log(`Application is running on: http://0.0.0.0:${port}`);
console.log(`Swagger documentation: http://0.0.0.0:${port}/api/docs`);
}
__name(bootstrap, "bootstrap");
bootstrap();
+26
View File
@@ -0,0 +1,26 @@
#!/bin/sh
set -eu
echo "[api] starting entrypoint at $(date -u +%Y-%m-%dT%H:%M:%SZ)"
echo "[api] node=$(node -v) cwd=$(pwd)"
echo "[api] release check: app.js=$(test -f app.js && echo yes || echo NO) prisma=$(test -f node_modules/prisma/build/index.js && echo yes || echo NO)"
if [ ! -f app.js ]; then
echo "[api] FATAL: app.js missing — release copy failed" >&2
exit 1
fi
if [ ! -f node_modules/prisma/build/index.js ]; then
echo "[api] FATAL: prisma CLI missing — commit apps/api/release/node_modules" >&2
ls -la node_modules 2>&1 || true
exit 1
fi
echo "[api] REDIS_HOST=${REDIS_HOST:-unset} REDIS_PORT=${REDIS_PORT:-unset}"
echo "[api] running prisma migrate deploy..."
node node_modules/prisma/build/index.js migrate deploy --schema=./prisma/schema.prisma
echo "[api] migrate done"
echo "[api] launching app.js on 0.0.0.0:${PORT:-3000}"
exec node app.js