Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +7 -8
Dockerfile
CHANGED
|
@@ -2,36 +2,35 @@ FROM python:3.11-slim-bookworm
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
-
# Install system dependencies
|
| 6 |
RUN apt-get update && apt-get install -y \
|
| 7 |
build-essential \
|
| 8 |
curl \
|
| 9 |
git \
|
| 10 |
sqlite3 \
|
| 11 |
libsqlite3-dev \
|
|
|
|
| 12 |
&& rm -rf /var/lib/apt/lists/*
|
| 13 |
|
| 14 |
# Create cache directories with proper permissions
|
| 15 |
RUN mkdir -p /tmp/cache/huggingface \
|
| 16 |
/tmp/cache/streamlit \
|
| 17 |
-
/tmp/cache/transformers \
|
| 18 |
/tmp/chroma_db && \
|
| 19 |
chmod -R 777 /tmp
|
| 20 |
|
| 21 |
# Set environment variables for cache locations
|
| 22 |
-
ENV
|
| 23 |
-
|
| 24 |
-
TRANSFORMERS_CACHE=/tmp/cache/transformers \
|
| 25 |
XDG_CACHE_HOME=/tmp/cache
|
| 26 |
|
| 27 |
# Copy requirements first for better layer caching
|
| 28 |
COPY requirements.txt ./
|
| 29 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 30 |
|
| 31 |
-
# Copy application code
|
| 32 |
-
COPY
|
| 33 |
|
| 34 |
-
# Expose the correct port
|
| 35 |
EXPOSE 8503
|
| 36 |
|
| 37 |
# Health check
|
|
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
+
# Install system dependencies including libgl1 for sentence-transformers
|
| 6 |
RUN apt-get update && apt-get install -y \
|
| 7 |
build-essential \
|
| 8 |
curl \
|
| 9 |
git \
|
| 10 |
sqlite3 \
|
| 11 |
libsqlite3-dev \
|
| 12 |
+
libgl1 \
|
| 13 |
&& rm -rf /var/lib/apt/lists/*
|
| 14 |
|
| 15 |
# Create cache directories with proper permissions
|
| 16 |
RUN mkdir -p /tmp/cache/huggingface \
|
| 17 |
/tmp/cache/streamlit \
|
|
|
|
| 18 |
/tmp/chroma_db && \
|
| 19 |
chmod -R 777 /tmp
|
| 20 |
|
| 21 |
# Set environment variables for cache locations
|
| 22 |
+
ENV HF_HOME=/tmp/cache/huggingface \
|
| 23 |
+
STREAMLIT_HOME=/tmp/cache/streamlit \
|
|
|
|
| 24 |
XDG_CACHE_HOME=/tmp/cache
|
| 25 |
|
| 26 |
# Copy requirements first for better layer caching
|
| 27 |
COPY requirements.txt ./
|
| 28 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 29 |
|
| 30 |
+
# Copy application code and PDF
|
| 31 |
+
COPY . .
|
| 32 |
|
| 33 |
+
# Expose the correct port
|
| 34 |
EXPOSE 8503
|
| 35 |
|
| 36 |
# Health check
|