trackingsvg commited on
Commit
9f69244
·
verified ·
1 Parent(s): 9db9515

Create 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
+ # Copy requirements first for better layer caching
6
+ COPY requirements.txt .
7
+ RUN pip install --no-cache-dir --upgrade pip && \
8
+ pip install --no-cache-dir -r requirements.txt
9
+
10
+ # Copy the application code
11
+ COPY . .
12
+
13
+ # Hugging Face Spaces only allows writing to /tmp
14
+ # This is CRUCIAL for model caching
15
+ ENV HF_HOME=/tmp
16
+ ENV TRANSFORMERS_CACHE=/tmp
17
+ ENV HUGGINGFACE_HUB_CACHE=/tmp
18
+
19
+ # Expose the correct port for Spaces
20
+ EXPOSE 7860
21
+
22
+ # Start the application
23
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]