Commit
·
d140df0
1
Parent(s):
147e0d3
fix: add build dependencies and install packages directly without Gradio
Browse files- Dockerfile +22 -7
- requirements-api.txt +18 -0
Dockerfile
CHANGED
|
@@ -3,12 +3,13 @@
|
|
| 3 |
|
| 4 |
FROM python:3.10-slim
|
| 5 |
|
| 6 |
-
# Install system dependencies
|
| 7 |
RUN apt-get update && apt-get install -y \
|
| 8 |
ffmpeg \
|
| 9 |
libgl1-mesa-glx \
|
| 10 |
libglib2.0-0 \
|
| 11 |
git \
|
|
|
|
| 12 |
&& rm -rf /var/lib/apt/lists/*
|
| 13 |
|
| 14 |
# Create user for Hugging Face Spaces (following HF Spaces best practices)
|
|
@@ -17,12 +18,26 @@ RUN useradd -m -u 1000 user
|
|
| 17 |
# Set working directory
|
| 18 |
WORKDIR /app
|
| 19 |
|
| 20 |
-
#
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
# Copy application code with ownership
|
| 28 |
COPY --chown=user:user . /app
|
|
|
|
| 3 |
|
| 4 |
FROM python:3.10-slim
|
| 5 |
|
| 6 |
+
# Install system dependencies including build tools
|
| 7 |
RUN apt-get update && apt-get install -y \
|
| 8 |
ffmpeg \
|
| 9 |
libgl1-mesa-glx \
|
| 10 |
libglib2.0-0 \
|
| 11 |
git \
|
| 12 |
+
build-essential \
|
| 13 |
&& rm -rf /var/lib/apt/lists/*
|
| 14 |
|
| 15 |
# Create user for Hugging Face Spaces (following HF Spaces best practices)
|
|
|
|
| 18 |
# Set working directory
|
| 19 |
WORKDIR /app
|
| 20 |
|
| 21 |
+
# Install Python dependencies as root (API-only, no Gradio)
|
| 22 |
+
RUN pip install --no-cache-dir --upgrade pip setuptools wheel && \
|
| 23 |
+
pip install --no-cache-dir \
|
| 24 |
+
fastapi>=0.115.2 \
|
| 25 |
+
uvicorn[standard]==0.24.0 \
|
| 26 |
+
python-multipart>=0.0.18 \
|
| 27 |
+
motor==3.3.2 \
|
| 28 |
+
pymongo==4.6.0 \
|
| 29 |
+
python-dotenv==1.0.0 \
|
| 30 |
+
dnspython==2.4.2 \
|
| 31 |
+
numpy==1.24.3 \
|
| 32 |
+
insightface==0.7.3 \
|
| 33 |
+
onnxruntime==1.17.3 \
|
| 34 |
+
opencv-python-headless \
|
| 35 |
+
psutil==5.9.5 \
|
| 36 |
+
tqdm==4.65.0 \
|
| 37 |
+
Pillow \
|
| 38 |
+
moviepy==1.0.3 \
|
| 39 |
+
imageio-ffmpeg \
|
| 40 |
+
huggingface_hub>=0.23.0
|
| 41 |
|
| 42 |
# Copy application code with ownership
|
| 43 |
COPY --chown=user:user . /app
|
requirements-api.txt
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# API-only requirements (no Gradio)
|
| 2 |
+
fastapi>=0.115.2
|
| 3 |
+
uvicorn[standard]==0.24.0
|
| 4 |
+
python-multipart>=0.0.18
|
| 5 |
+
motor==3.3.2
|
| 6 |
+
pymongo==4.6.0
|
| 7 |
+
python-dotenv==1.0.0
|
| 8 |
+
dnspython==2.4.2
|
| 9 |
+
numpy==1.24.3
|
| 10 |
+
insightface==0.7.3
|
| 11 |
+
onnxruntime==1.17.3
|
| 12 |
+
opencv-python-headless
|
| 13 |
+
psutil==5.9.5
|
| 14 |
+
tqdm==4.65.0
|
| 15 |
+
Pillow
|
| 16 |
+
moviepy==1.0.3
|
| 17 |
+
imageio-ffmpeg
|
| 18 |
+
huggingface_hub>=0.23.0
|