Claude commited on
Commit
f2c197f
·
1 Parent(s): 00b61f3

Fix Render deployment - use dynamic $PORT

Browse files

- Update Dockerfile CMD to use ${PORT:-8000} for Render compatibility
- Disable Docker HEALTHCHECK (Render has its own health checks)
- Add render.yaml for proper deployment configuration

Files changed (2) hide show
  1. Dockerfile +6 -6
  2. render.yaml +15 -0
Dockerfile CHANGED
@@ -35,12 +35,12 @@ COPY app/ ./app/
35
  # Add local bin to PATH
36
  ENV PATH=/root/.local/bin:$PATH
37
 
38
- # Expose port
39
  EXPOSE 8000
40
 
41
- # Health check
42
- HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
43
- CMD curl -f http://localhost:8000/health || exit 1
44
 
45
- # Run the application
46
- CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
 
35
  # Add local bin to PATH
36
  ENV PATH=/root/.local/bin:$PATH
37
 
38
+ # Expose port (Render uses $PORT dynamically)
39
  EXPOSE 8000
40
 
41
+ # Health check (disabled for Render compatibility - Render has its own health checks)
42
+ # HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
43
+ # CMD curl -f http://localhost:${PORT:-8000}/health || exit 1
44
 
45
+ # Run the application (use $PORT for Render/cloud compatibility, default to 8000)
46
+ CMD uvicorn app.main:app --host 0.0.0.0 --port ${PORT:-8000}
render.yaml ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Render deployment configuration
2
+ # https://render.com/docs/blueprint-spec
3
+
4
+ services:
5
+ - type: web
6
+ name: socar-hackathon
7
+ env: docker
8
+ dockerfilePath: ./Dockerfile
9
+ dockerContext: .
10
+ healthCheckPath: /health
11
+ envVars:
12
+ - key: PRODUCTION
13
+ value: "false"
14
+ - key: PYTHONUNBUFFERED
15
+ value: "1"