webcodelab commited on
Commit
594923c
·
verified ·
1 Parent(s): 70ce8c9

Upload Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +26 -0
Dockerfile ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ # Create instance directory with proper permissions
13
+ RUN mkdir -p /app/instance && chmod 777 /app/instance
14
+
15
+ # Optional: avoid using cached Hugging Face models in root directory
16
+ ENV TRANSFORMERS_CACHE=/app/cache
17
+ ENV HF_HOME=/app/cache
18
+
19
+ # Set PYTHONPATH (useful if you're importing from app/)
20
+ ENV PYTHONPATH=/app
21
+
22
+ # HF Spaces default port is 7860
23
+ EXPOSE 7860
24
+
25
+ # Start server
26
+ CMD ["gunicorn", "--bind", "0.0.0.0:7860", "main:app"]