File size: 906 Bytes
7a3ba0e
06acafa
9a319a8
7a3ba0e
 
 
 
 
06acafa
7a3ba0e
 
9a319a8
 
7a3ba0e
 
9a319a8
06acafa
 
 
 
7a3ba0e
9a319a8
06acafa
7a3ba0e
 
9a319a8
7a3ba0e
06acafa
9a319a8
7a3ba0e
 
9a319a8
7a3ba0e
 
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
# Use official slim Python base image
FROM python:3.10-slim

# Environment settings
ENV PYTHONDONTWRITEBYTECODE=1 \
    PYTHONUNBUFFERED=1 \
    TRANSFORMERS_CACHE=/tmp/huggingface \
    HF_HOME=/tmp/huggingface

# Create cache and working directories
RUN mkdir -p /tmp/huggingface /app/data /app/vectorstore
WORKDIR /app

# Install OS dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
    build-essential \
    libglib2.0-0 \
    libsm6 \
    libxext6 \
    libxrender-dev \
 && rm -rf /var/lib/apt/lists/*

# Install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir --upgrade pip && pip install --no-cache-dir -r requirements.txt

# Copy application code
COPY . .

# Expose ports for Streamlit and FastAPI
EXPOSE 8501 8000

# Run both Streamlit and FastAPI
CMD ["sh", "-c", "streamlit run app.py & exec uvicorn api:app --host 0.0.0.0 --port 8000"]