Spaces:
Sleeping
Sleeping
Commit
·
5c6d0b5
1
Parent(s):
8857eb3
FIX: Added libGL dependencies for OpenCV/PyTorch visualization
Browse files- Dockerfile +18 -3
Dockerfile
CHANGED
|
@@ -1,21 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
| 1 |
# Gunakan image Python yang stabil untuk AI/ML
|
| 2 |
FROM python:3.9-slim
|
| 3 |
|
| 4 |
# Set working directory di dalam container
|
| 5 |
WORKDIR /app
|
| 6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
# Salin requirements.txt dan instal semua dependencies
|
| 8 |
COPY requirements.txt .
|
| 9 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 10 |
|
| 11 |
# Salin semua file proyek ke dalam container
|
| 12 |
-
# Termasuk model, kode, dan assets
|
| 13 |
COPY . /app
|
| 14 |
|
| 15 |
# Tentukan environment variable untuk otentikasi DINOv3
|
| 16 |
-
# Token ini harus diatur di
|
| 17 |
ENV HUGGINGFACE_TOKEN=
|
| 18 |
|
| 19 |
# Perintah untuk menjalankan server FastAPI Anda
|
| 20 |
-
#
|
| 21 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 1 |
+
# ======================================================
|
| 2 |
+
# DOCKERFILE FINAL (FIXED LIBGL DEPENDENCIES)
|
| 3 |
+
# ======================================================
|
| 4 |
# Gunakan image Python yang stabil untuk AI/ML
|
| 5 |
FROM python:3.9-slim
|
| 6 |
|
| 7 |
# Set working directory di dalam container
|
| 8 |
WORKDIR /app
|
| 9 |
|
| 10 |
+
# --- TAMBAHAN WAJIB UNTUK MEMPERBAIKI LIBGL.SO.1 ERROR ---
|
| 11 |
+
# Instalasi dependencies sistem Linux yang diperlukan oleh OpenCV/PyTorch
|
| 12 |
+
# Ini adalah solusi standar untuk "cannot open shared object file" error.
|
| 13 |
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 14 |
+
libgl1 \
|
| 15 |
+
libsm6 \
|
| 16 |
+
libxext6 \
|
| 17 |
+
libxrender1 \
|
| 18 |
+
&& apt-get clean \
|
| 19 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 20 |
+
# ------------------------------------------------------------
|
| 21 |
+
|
| 22 |
# Salin requirements.txt dan instal semua dependencies
|
| 23 |
COPY requirements.txt .
|
| 24 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 25 |
|
| 26 |
# Salin semua file proyek ke dalam container
|
| 27 |
+
# Termasuk model, kode, dan assets (termasuk folder OVR_Checkpoints)
|
| 28 |
COPY . /app
|
| 29 |
|
| 30 |
# Tentukan environment variable untuk otentikasi DINOv3
|
| 31 |
+
# Token ini harus diatur di Hugging Face Space Secrets!
|
| 32 |
ENV HUGGINGFACE_TOKEN=
|
| 33 |
|
| 34 |
# Perintah untuk menjalankan server FastAPI Anda
|
| 35 |
+
# Port 7860 adalah port default yang disukai oleh Hugging Face.
|
| 36 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|