Spaces:
Build error
Build error
Update Dockerfile
Browse files- Dockerfile +37 -35
Dockerfile
CHANGED
|
@@ -1,35 +1,37 @@
|
|
| 1 |
-
FROM python:3.9-slim
|
| 2 |
-
|
| 3 |
-
WORKDIR /app
|
| 4 |
-
|
| 5 |
-
# System dependencies for face_recognition
|
| 6 |
-
RUN apt-get update && apt-get install -y \
|
| 7 |
-
build-essential \
|
| 8 |
-
cmake \
|
| 9 |
-
libsm6 \
|
| 10 |
-
libxext6 \
|
| 11 |
-
libxrender-dev \
|
| 12 |
-
libgl1-mesa-glx \
|
| 13 |
-
git \
|
| 14 |
-
curl \
|
| 15 |
-
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
| 16 |
-
|
| 17 |
-
#
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
RUN
|
| 28 |
-
RUN
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM python:3.9-slim
|
| 2 |
+
|
| 3 |
+
WORKDIR /app
|
| 4 |
+
|
| 5 |
+
# System dependencies for face_recognition
|
| 6 |
+
RUN apt-get update && apt-get install -y \
|
| 7 |
+
build-essential \
|
| 8 |
+
cmake \
|
| 9 |
+
libsm6 \
|
| 10 |
+
libxext6 \
|
| 11 |
+
libxrender-dev \
|
| 12 |
+
libgl1-mesa-glx \
|
| 13 |
+
git \
|
| 14 |
+
curl \
|
| 15 |
+
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
| 16 |
+
|
| 17 |
+
# Create necessary directories
|
| 18 |
+
RUN mkdir -p uploaded_images
|
| 19 |
+
RUN mkdir -p static
|
| 20 |
+
RUN mkdir -p models
|
| 21 |
+
RUN mkdir -p uploaded_videos
|
| 22 |
+
|
| 23 |
+
# Install Python requirements
|
| 24 |
+
RUN pip install fastapi uvicorn python-multipart face-recognition opencv-python-headless matplotlib torch torchvision numpy pillow
|
| 25 |
+
|
| 26 |
+
# Download model from Hugging Face
|
| 27 |
+
RUN pip install huggingface_hub
|
| 28 |
+
RUN python -c "from huggingface_hub import hf_hub_download; hf_hub_download(repo_id='tayyabimam/Deepfake', filename='model.pt', local_dir='/app/models')"
|
| 29 |
+
|
| 30 |
+
# Copy app.py
|
| 31 |
+
COPY app.py ./
|
| 32 |
+
|
| 33 |
+
# Expose the port
|
| 34 |
+
EXPOSE 7860
|
| 35 |
+
|
| 36 |
+
# Start the server
|
| 37 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|