File size: 1,263 Bytes
eb731f7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# syntax=docker/dockerfile:1.4

# Use an official Python runtime as a parent image
FROM python:3.9-slim

# Set the working directory in the container
WORKDIR /app

# Install system-level dependencies
COPY packages.txt .
RUN apt-get update && apt-get install -y --no-install-recommends $(cat packages.txt) && rm -rf /var/lib/apt/lists/*

# Copy requirements and install dependencies with pip cache mount (HUGE speedup on rebuilds)
COPY requirements.txt .
RUN --mount=type=cache,target=/root/.cache/pip \
    pip install --no-cache-dir -r requirements.txt

# Copy the rest of the application files
COPY . .

# Extract compressed chroma_db if present (for cloud deployment optimization)
RUN if [ -f data/chroma_db.tar.gz ]; then \
    echo "📦 Extracting chroma_db..." && \
    tar -xzf data/chroma_db.tar.gz -C ./ && \
    rm data/chroma_db.tar.gz; \
    fi

# Make port 8501 available to the world outside this container
EXPOSE 8501

# Cloud deployment environment variables (defaults for graceful degradation)
ENV LLM_PROVIDER=openai
ENV EMBEDDING_PROVIDER=openai
ENV ENABLE_RERANK=false
ENV ENABLE_HYBRID=true
ENV ENABLE_REDIS=false

# Run app.py when the container launches
CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]