Repository navigation
Expand file tree
/
Copy pathrender.yaml
More file actions
55 lines (47 loc) · 1.63 KB
/
Copy pathrender.yaml
File metadata and controls
55 lines (47 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# Render Deployment Configuration
# This file configures worker limits and resource allocation for deployment
services:
- type: web
name: anime-recommender-backend
runtime: python
plan: free # Options: free, starter, standard, pro
buildCommand: cd backend && pip install -r requirements.txt
startCommand: cd backend && uvicorn app.main:app --host 0.0.0.0 --port $PORT --workers 1
# Environment variables
envVars:
- key: PYTHON_VERSION
value: 3.12
- key: PORT
value: 8000
# Resource limits for Free tier (512 MB RAM)
# For higher tiers, adjust these values:
# - Starter: 512 MB RAM, 0.5 CPU
# - Standard: 1 GB RAM, 1 CPU
# - Pro: 2 GB RAM, 2 CPU
# Worker configuration
# Reduce workers to prevent OOM with 512 MB limit
# Each worker loads the full application (~292 MB)
# With 512 MB limit: max 1 worker
# With 1 GB limit: max 2-3 workers
# With 2 GB limit: max 4-6 workers
# To manually control workers in startCommand:
# --workers 1 (for 512 MB)
# --workers 2 (for 1 GB)
# --workers 4 (for 2 GB)
# Health check
healthCheckPath: /health
# Auto-scaling (available on paid tiers)
# autoscale:
# min: 1
# max: 3
# targetMemoryPercent: 80
# targetCPUPercent: 70
# Alternative: Use Dockerfile for more control
# Create a Dockerfile in the backend directory:
#
# FROM python:3.12-slim
# WORKDIR /app
# COPY requirements.txt .
# RUN pip install --no-cache-dir -r requirements.txt
# COPY . .
# CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", "--workers", "1"]