360 Secure SkillHub
360 安全技能中心

Polsia Render Infrastructure

汇总 Polsia 应用部署到 Render 的平台约束:必须提供 /health 健康检查端点并返回 200;构建阶段无法访问 DATABASE_URL,迁移需在服务启动时执行;package.json 必须保留 build 与 start 脚本,含前端时用 --include=dev 安装依赖;文件系统临时,禁用本地磁盘存储,改用 R2 代理。

分类:开发
agentlevier
agentlevier
热度 12.41
最近更新 2026-07-02 06:31:32

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add agentlevier/polsia-render-infra
兼容性
通用兼容
联网要求
需要联网
数据出网
必须出网
Metadata
name
render-infra
description
Apply Render-specific deployment requirements for Polsia apps, including /health checks and migration strategy.

Render Infrastructure

Polsia apps deploy to Render. This skill covers platform-specific requirements.

Health Check Endpoint (CRITICAL)

Render services are configured with a health check at /health. Your app MUST have this:

app.get('/health', (req, res) => { res.status(200).json({ status: 'ok' }); });

Requirements: Endpoint MUST be at /health (not /api/health). Must respond with HTTP 200. If health check fails, deploy times out after 15 minutes.

DATABASE_URL Not Available in Build

Render's buildCommand does NOT have access to DATABASE_URL. Run migrations on server startup, not in buildCommand.

NEVER run migrations in Render's buildCommand - it will fail.

Package.json Rules (CRITICAL)

Required scripts: build and start. If no frontend: "build": "echo 'No build step required'". NEVER remove the build script - deploys will fail.

With frontend: "build": "cd client && npm install --include=dev && npm run build". Use --include=dev because vite/tailwind are devDependencies.

Filesystem is Ephemeral

Render's filesystem resets on every deploy. NEVER use multer.diskStorage() - files will be LOST. Use R2 proxy for file storage.

Frontend Build

Create frontend in client/ subdirectory. Serve built files: app.use(express.static('client/dist'));