shank commited on
Commit
30f698e
·
1 Parent(s): e2cf8f8

adding dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +23 -0
Dockerfile ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.10-slim
2
+
3
+ WORKDIR /app
4
+
5
+ # Install curl for healthcheck
6
+ RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
7
+
8
+ # Install dependencies first (layer cache optimization)
9
+ COPY requirements.txt .
10
+ RUN pip install --no-cache-dir -r requirements.txt
11
+
12
+ # Copy all application code
13
+ COPY . .
14
+
15
+ # Port 8000 is required by hackathon infrastructure
16
+ EXPOSE 8000
17
+
18
+ # Health check — hackathon automated ping requires this to return 200
19
+ HEALTHCHECK --interval=30s --timeout=10s --start-period=10s --retries=3 \
20
+ CMD curl -f http://localhost:8000/health || exit 1
21
+
22
+ # Single worker — environment is 2vCPU, multi-worker causes resource issues
23
+ CMD ["uvicorn", "env.server:app", "--host", "0.0.0.0", "--port", "8000", "--workers", "1"]