Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +5 -2
Dockerfile
CHANGED
|
@@ -25,11 +25,14 @@ RUN pip install --upgrade pip
|
|
| 25 |
COPY requirements.txt .
|
| 26 |
|
| 27 |
# Install dependencies from requirements.txt
|
| 28 |
-
# Split installation to isolate torch with custom index URL if needed
|
| 29 |
RUN pip install --no-cache-dir -r requirements.txt || { echo "Failed to install requirements"; exit 1; }
|
| 30 |
|
|
|
|
|
|
|
|
|
|
| 31 |
# Create necessary directories
|
| 32 |
-
RUN mkdir -p /app/data
|
|
|
|
| 33 |
|
| 34 |
# Copy all project files
|
| 35 |
COPY . .
|
|
|
|
| 25 |
COPY requirements.txt .
|
| 26 |
|
| 27 |
# Install dependencies from requirements.txt
|
|
|
|
| 28 |
RUN pip install --no-cache-dir -r requirements.txt || { echo "Failed to install requirements"; exit 1; }
|
| 29 |
|
| 30 |
+
# Pre-download the SentenceTransformer model
|
| 31 |
+
RUN python -c "from sentence_transformers import SentenceTransformer; SentenceTransformer('all-MiniLM-L6-v2')" || { echo "Failed to pre-download model"; exit 1; }
|
| 32 |
+
|
| 33 |
# Create necessary directories
|
| 34 |
+
RUN mkdir -p /app/data /app/cache && \
|
| 35 |
+
chown -R myuser:myuser /app
|
| 36 |
|
| 37 |
# Copy all project files
|
| 38 |
COPY . .
|