Spaces:
Runtime error
Runtime error
Create Dockerfile
Browse files- Dockerfile +33 -0
Dockerfile
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM python:3.10-slim
|
| 2 |
+
|
| 3 |
+
ENV DEBIAN_FRONTEND=noninteractive \
|
| 4 |
+
PIP_NO_CACHE_DIR=1 \
|
| 5 |
+
PYTHONDONTWRITEBYTECODE=1 \
|
| 6 |
+
PYTHONUNBUFFERED=1 \
|
| 7 |
+
HF_HUB_DISABLE_TELEMETRY=1 \
|
| 8 |
+
HF_HUB_ENABLE_HF_TRANSFER=0
|
| 9 |
+
|
| 10 |
+
WORKDIR /app
|
| 11 |
+
|
| 12 |
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 13 |
+
git ffmpeg \
|
| 14 |
+
libgl1 libsm6 libxext6 \
|
| 15 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 16 |
+
|
| 17 |
+
COPY requirements-full.txt /app/requirements-full.txt
|
| 18 |
+
RUN pip install --upgrade pip && pip install -r /app/requirements-full.txt
|
| 19 |
+
|
| 20 |
+
COPY . /app
|
| 21 |
+
|
| 22 |
+
# Copy InsightFace model pack (buffalo_l) to the default insightface cache dir
|
| 23 |
+
RUN mkdir -p /root/.insightface/models/buffalo_l && \
|
| 24 |
+
cp -r /app/models/buffalo_l/* /root/.insightface/models/buffalo_l/
|
| 25 |
+
|
| 26 |
+
# Hard checks for offline-critical files
|
| 27 |
+
RUN test -f /app/models/inswapper_128.onnx && \
|
| 28 |
+
test -f /app/models/GFPGANv1.3.pth && \
|
| 29 |
+
test -f /root/.insightface/models/buffalo_l/w600k_r50.onnx && \
|
| 30 |
+
test -f /root/.insightface/models/buffalo_l/det_10g.onnx
|
| 31 |
+
|
| 32 |
+
EXPOSE 7860
|
| 33 |
+
CMD ["python", "app.py"]
|