AIcoder35235 commited on
Commit
4bd3538
·
verified ·
1 Parent(s): 03e9c25

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -7
Dockerfile CHANGED
@@ -4,19 +4,23 @@ FROM python:3.11-slim
4
  # 2. Set the working directory
5
  WORKDIR /app
6
 
7
- # 3. Install dependencies (Pre-downloading the NEW model we discussed)
8
- RUN pip install --no-cache-dir fastapi uvicorn transformers pillow pydantic requests torch torchvision --index-url https://download.pytorch.org/whl/cpu
 
 
 
 
 
9
  RUN python -c "from transformers import pipeline; pipeline('image-classification', model='prithivMLmods/deepfake-detector-model-v1')"
10
 
11
- # 4. Copy your app.py specifically into the current WORKDIR (/app)
12
- # This ensures uvicorn can find the "app" module
13
  COPY app.py /app/app.py
14
 
15
- # 5. Set environment variable to make sure Python finds the /app folder
16
  ENV PYTHONPATH=/app
17
 
18
- # 6. Expose port
19
  EXPOSE 7860
20
 
21
- # 7. Start the node - using the full path to be safe
22
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
4
  # 2. Set the working directory
5
  WORKDIR /app
6
 
7
+ # 3. Install PyTorch (CPU version) FIRST from its custom index
8
+ RUN pip install --no-cache-dir torch torchvision --index-url https://download.pytorch.org/whl/cpu
9
+
10
+ # 4. Install API dependencies SECOND from the normal Python index
11
+ RUN pip install --no-cache-dir fastapi uvicorn transformers pillow pydantic requests
12
+
13
+ # 5. Pre-download the NEW SigLIP deepfake model
14
  RUN python -c "from transformers import pipeline; pipeline('image-classification', model='prithivMLmods/deepfake-detector-model-v1')"
15
 
16
+ # 6. Copy your app.py specifically into the current WORKDIR (/app)
 
17
  COPY app.py /app/app.py
18
 
19
+ # 7. Set environment variable to make sure Python finds the /app folder
20
  ENV PYTHONPATH=/app
21
 
22
+ # 8. Expose port
23
  EXPOSE 7860
24
 
25
+ # 9. Start the node
26
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]