|
| 1 | +services: |
| 2 | + # 1. PostgreSQL Database |
| 3 | + - type: pgo |
| 4 | + name: cloudgauge-db |
| 5 | + plan: free |
| 6 | + databaseName: costanalyzer |
| 7 | + user: dev |
| 8 | + |
| 9 | + # 2. Redis Instance |
| 10 | + - type: redis |
| 11 | + name: cloudgauge-redis |
| 12 | + plan: free |
| 13 | + ipAllowList: [] # Allows connections from other Render services |
| 14 | + |
| 15 | + # 3. Fastify Web Service (Backend) |
| 16 | + - type: web |
| 17 | + name: cloudgauge-server |
| 18 | + env: node |
| 19 | + plan: free |
| 20 | + rootDir: . # Assuming this file is placed in the server repository root |
| 21 | + buildCommand: npm install && npm run build |
| 22 | + # This preDeploy command ensures the database is migrated before the app starts, preventing crashes! |
| 23 | + # If the migration fails, the deploy stops, saving your live app from crashing. |
| 24 | + preDeployCommand: npm run migrate |
| 25 | + startCommand: npm start |
| 26 | + envVars: |
| 27 | + - key: NODE_ENV |
| 28 | + value: production |
| 29 | + - key: HOST |
| 30 | + value: 0.0.0.0 |
| 31 | + - key: DATABASE_URL |
| 32 | + fromDatabase: |
| 33 | + name: cloudgauge-db |
| 34 | + property: connectionString |
| 35 | + - key: REDIS_URL |
| 36 | + fromService: |
| 37 | + type: redis |
| 38 | + name: cloudgauge-redis |
| 39 | + property: connectionString |
| 40 | + - key: JWT_SECRET |
| 41 | + generateValue: true # Render will automatically generate a secure 256-bit secret string for you |
| 42 | + - key: GOOGLE_CLIENT_ID |
| 43 | + sync: false # You must add this manually in the Render dashboard |
| 44 | + - key: GOOGLE_CLIENT_SECRET |
| 45 | + sync: false # You must add this manually in the Render dashboard |
| 46 | + - key: GOOGLE_CALLBACK_URL |
| 47 | + sync: false # Set this to https://<your-render-url>/auth/google/callback manually |
| 48 | + - key: GITHUB_TOKEN |
| 49 | + sync: false # Add manually |
| 50 | + - key: OPENAI_API_KEY |
| 51 | + sync: false # Add manually |
| 52 | + - key: ANTHROPIC_API_KEY |
| 53 | + sync: false # Add manually |
| 54 | + - key: AWS_PRICING_REGION |
| 55 | + value: us-east-1 |
| 56 | + - key: PRICING_TTL_SECS |
| 57 | + value: 3600 |
| 58 | + - key: MAX_FILE_SIZE_KB |
| 59 | + value: 500 |
| 60 | + - key: RATE_LIMIT_MAX |
| 61 | + value: 100 |
| 62 | + - key: RATE_LIMIT_WINDOW |
| 63 | + value: 1 minute |
| 64 | + - key: LOG_LEVEL |
| 65 | + value: info |
0 commit comments