RAHUL-13 commited on
Commit
5c60763
·
verified ·
1 Parent(s): af65fe4

Upload Dockerfile with huggingface_hub

Browse files
Files changed (1) hide show
  1. Dockerfile +24 -0
Dockerfile ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.11-slim
2
+
3
+ WORKDIR /app
4
+
5
+ # Install dependencies first (cached layer)
6
+ COPY requirements.txt .
7
+ RUN pip install --no-cache-dir -r requirements.txt
8
+
9
+ # Copy application code
10
+ COPY models.py .
11
+ COPY tasks.py .
12
+ COPY graders.py .
13
+ COPY environment.py .
14
+ COPY app.py .
15
+
16
+ # HF Spaces expects port 7860
17
+ EXPOSE 7860
18
+
19
+ # Health check
20
+ HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
21
+ CMD python -c "import requests; requests.get('http://localhost:7860/health').raise_for_status()"
22
+
23
+ # Run the server
24
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]