AndrewKof commited on
Commit
f9e81e2
·
1 Parent(s): d317c29

Move Dockerfile to root for Hugging Face deployment

Browse files
Files changed (1) hide show
  1. Dockerfile +23 -0
Dockerfile ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use a lightweight Python image
2
+ FROM python:3.10-slim
3
+
4
+ # Set working directory
5
+ WORKDIR /code
6
+
7
+ # Copy requirements and install dependencies
8
+ COPY requirements.txt .
9
+ RUN pip install --no-cache-dir -r requirements.txt
10
+
11
+ # Copy your FastAPI app and dinov2 module
12
+ COPY app ./app
13
+ COPY dinov2 ./dinov2
14
+
15
+ # Set environment variable for module discovery
16
+ ENV PYTHONPATH=/code
17
+
18
+ # Expose the default Hugging Face Spaces port
19
+ EXPOSE 7860
20
+
21
+ # Run the FastAPI app
22
+ CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
23
+