AIcoder35235 commited on
Commit
a32a113
·
verified ·
1 Parent(s): a850497

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +23 -0
Dockerfile ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # 1. Use a lightweight Python base
2
+ FROM python:3.11-slim
3
+
4
+ # 2. Set the working directory
5
+ WORKDIR /app
6
+
7
+ # 3. Install PyTorch (CPU version)
8
+ RUN pip install --no-cache-dir torch torchvision --index-url https://download.pytorch.org/whl/cpu
9
+
10
+ # 4. Install API dependencies
11
+ RUN pip install --no-cache-dir fastapi uvicorn transformers pillow pydantic requests
12
+
13
+ # 5. THE CHEAT CODE: Pre-download the Deepfake weights
14
+ RUN python -c "from transformers import pipeline; pipeline('image-classification', model='dima806/deepfake_vs_real_image_detection')"
15
+
16
+ # 6. Copy code
17
+ COPY app.py .
18
+
19
+ # 7. Expose port
20
+ EXPOSE 7860
21
+
22
+ # 8. Start the node
23
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]