Commit ·
ba231b9
1
Parent(s): ecf3c7c
adding the render file
Browse files- render.yml +66 -0
render.yml
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# This is the instruction manual for deploying on Render.
|
| 2 |
+
services:
|
| 3 |
+
# Service 1: The Redis instance for Celery
|
| 4 |
+
- type: redis
|
| 5 |
+
name: redis-cache
|
| 6 |
+
plan: free
|
| 7 |
+
# This is required for security on Render's free plan
|
| 8 |
+
ipAllowList: [] # Allows internal connections, blocks public
|
| 9 |
+
|
| 10 |
+
# Service 2: The Backend FastAPI Web Server
|
| 11 |
+
- type: web
|
| 12 |
+
name: backend-api
|
| 13 |
+
plan: free
|
| 14 |
+
env: docker
|
| 15 |
+
# Tell Render where to find the Dockerfile and the build context
|
| 16 |
+
dockerfilePath: ./backend/Dockerfile
|
| 17 |
+
dockerContext: .
|
| 18 |
+
# Render's free web services need a health check on port 10000
|
| 19 |
+
healthCheckPath: /
|
| 20 |
+
# We need to explicitly tell Render which port our service is on
|
| 21 |
+
envVars:
|
| 22 |
+
- key: PORT
|
| 23 |
+
value: 10000
|
| 24 |
+
- key: DATABASE_URL
|
| 25 |
+
fromDatabase:
|
| 26 |
+
name: neon-database # We will create this name in the Render UI
|
| 27 |
+
property: connectionString
|
| 28 |
+
- key: CELERY_BROKER_URL
|
| 29 |
+
fromService:
|
| 30 |
+
type: redis
|
| 31 |
+
name: redis-cache
|
| 32 |
+
property: connectionString
|
| 33 |
+
- key: CELERY_RESULT_BACKEND
|
| 34 |
+
fromService:
|
| 35 |
+
type: redis
|
| 36 |
+
name: redis-cache
|
| 37 |
+
property: connectionString
|
| 38 |
+
- key: GOOGLE_API_KEY
|
| 39 |
+
sync: false # Set this secret manually in the Render UI
|
| 40 |
+
|
| 41 |
+
# Service 3: The Celery Background Worker
|
| 42 |
+
- type: worker
|
| 43 |
+
name: celery-worker
|
| 44 |
+
plan: free
|
| 45 |
+
env: docker
|
| 46 |
+
dockerfilePath: ./backend/Dockerfile
|
| 47 |
+
dockerContext: .
|
| 48 |
+
# This command overrides the CMD in the Dockerfile to start the worker instead
|
| 49 |
+
dockerCommand: "python -m celery -A celery_worker.celery worker --loglevel=info"
|
| 50 |
+
envVars:
|
| 51 |
+
- key: DATABASE_URL
|
| 52 |
+
fromDatabase:
|
| 53 |
+
name: neon-database # Must match the name below
|
| 54 |
+
property: connectionString
|
| 55 |
+
- key: CELERY_BROKER_URL
|
| 56 |
+
fromService:
|
| 57 |
+
type: redis
|
| 58 |
+
name: redis-cache
|
| 59 |
+
property: connectionString
|
| 60 |
+
- key: CELERY_RESULT_BACKEND
|
| 61 |
+
fromService:
|
| 62 |
+
type: redis
|
| 63 |
+
name: redis-cache
|
| 64 |
+
property: connectionString
|
| 65 |
+
- key: GOOGLE_API_KEY
|
| 66 |
+
sync: false
|