Spaces:
Running
Running
GitHub Actions commited on
Commit ·
4cf7435
1
Parent(s): 0acc259
Deploy b3bf0e5
Browse files- Dockerfile +4 -1
Dockerfile
CHANGED
|
@@ -15,8 +15,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends git \
|
|
| 15 |
&& rm -rf /var/lib/apt/lists/*
|
| 16 |
|
| 17 |
# Install dependencies first for better Docker layer caching.
|
|
|
|
|
|
|
|
|
|
| 18 |
COPY requirements.txt .
|
| 19 |
-
RUN pip install --no-cache-dir -r requirements.txt
|
| 20 |
|
| 21 |
# Copy app source after dependencies so code changes don't bust the pip cache layer.
|
| 22 |
COPY . .
|
|
|
|
| 15 |
&& rm -rf /var/lib/apt/lists/*
|
| 16 |
|
| 17 |
# Install dependencies first for better Docker layer caching.
|
| 18 |
+
# --prefer-binary: always take a pre-built wheel over compiling from source.
|
| 19 |
+
# Without this, onnxruntime (pulled by fastembed) compiles from source and
|
| 20 |
+
# adds 20-40 min to the build, causing HF Spaces to appear stuck.
|
| 21 |
COPY requirements.txt .
|
| 22 |
+
RUN pip install --no-cache-dir --prefer-binary -r requirements.txt
|
| 23 |
|
| 24 |
# Copy app source after dependencies so code changes don't bust the pip cache layer.
|
| 25 |
COPY . .
|