webcodelab commited on
Commit
0c3e27b
·
verified ·
1 Parent(s): a615269

Upload Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +25 -0
Dockerfile ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.10-slim
2
+
3
+ WORKDIR /app
4
+
5
+ # Install dependencies
6
+ COPY requirements.txt .
7
+ RUN pip install --no-cache-dir -r requirements.txt
8
+
9
+ # Copy all files
10
+ COPY . .
11
+
12
+ # Optional: avoid using cached Hugging Face models in root directory
13
+ ENV TRANSFORMERS_CACHE=/app/cache
14
+ ENV HF_HOME=/app/cache
15
+
16
+ # Set PYTHONPATH (useful if you're importing from app/)
17
+ ENV PYTHONPATH=/app
18
+
19
+ # HF Spaces default port is 7860
20
+ EXPOSE 7860
21
+
22
+ # Start server
23
+ CMD ["gunicorn", "--bind", "0.0.0.0:7860", "app:app"]
24
+
25
+