Spaces:
Sleeping
Sleeping
Commit
·
737625d
1
Parent(s):
6bd2bc0
Fix Docker build: simplify system dependencies, use minimal packages
Browse files- Dockerfile +12 -7
- packages.txt +1 -7
- requirements.txt +1 -0
Dockerfile
CHANGED
|
@@ -4,13 +4,18 @@ FROM python:3.9-slim
|
|
| 4 |
# Set working directory
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
-
# Copy
|
| 8 |
-
COPY
|
| 9 |
-
|
| 10 |
-
# Install system dependencies
|
| 11 |
-
RUN apt-get update && \
|
| 12 |
-
|
| 13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
# Install Python dependencies
|
| 16 |
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
| 4 |
# Set working directory
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
+
# Copy requirements first for better caching
|
| 8 |
+
COPY requirements.txt ./
|
| 9 |
+
|
| 10 |
+
# Install minimal system dependencies for OpenCV and PyTorch
|
| 11 |
+
RUN apt-get update && apt-get install -y \
|
| 12 |
+
build-essential \
|
| 13 |
+
curl \
|
| 14 |
+
git \
|
| 15 |
+
wget \
|
| 16 |
+
libglib2.0-0 \
|
| 17 |
+
libgomp1 \
|
| 18 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 19 |
|
| 20 |
# Install Python dependencies
|
| 21 |
RUN pip install --no-cache-dir -r requirements.txt
|
packages.txt
CHANGED
|
@@ -1,12 +1,6 @@
|
|
| 1 |
build-essential
|
| 2 |
curl
|
| 3 |
git
|
| 4 |
-
|
| 5 |
libglib2.0-0
|
| 6 |
libgomp1
|
| 7 |
-
libsm6
|
| 8 |
-
libxext6
|
| 9 |
-
libxrender-dev
|
| 10 |
-
libfontconfig1
|
| 11 |
-
libice6
|
| 12 |
-
wget
|
|
|
|
| 1 |
build-essential
|
| 2 |
curl
|
| 3 |
git
|
| 4 |
+
wget
|
| 5 |
libglib2.0-0
|
| 6 |
libgomp1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
requirements.txt
CHANGED
|
@@ -12,6 +12,7 @@ omegaconf>=2.2.0
|
|
| 12 |
fastapi>=0.68.0
|
| 13 |
uvicorn>=0.15.0
|
| 14 |
websockets>=10.0
|
|
|
|
| 15 |
|
| 16 |
# Image processing
|
| 17 |
opencv-python-headless>=4.5.0
|
|
|
|
| 12 |
fastapi>=0.68.0
|
| 13 |
uvicorn>=0.15.0
|
| 14 |
websockets>=10.0
|
| 15 |
+
python-multipart>=0.0.5
|
| 16 |
|
| 17 |
# Image processing
|
| 18 |
opencv-python-headless>=4.5.0
|