File size: 939 Bytes
1eaee2c
 
 
 
 
 
377ff62
 
 
 
7dcb915
377ff62
 
 
 
 
7dcb915
377ff62
1eaee2c
377ff62
 
1eaee2c
377ff62
1eaee2c
 
377ff62
 
 
1eaee2c
377ff62
 
1eaee2c
377ff62
a589d01
 
 
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
# ---- Base image ----
FROM python:3.11-slim

# ---- Working directory ----
WORKDIR /app

# ---- Set environment variables ----
ENV TRANSFORMERS_CACHE=/app/.cache/huggingface
ENV HF_HOME=/app/.cache/huggingface
ENV PYTHONUNBUFFERED=1

# ---- Install system dependencies ----
RUN apt-get update && apt-get install -y --no-install-recommends \
    build-essential \
    curl \
    && rm -rf /var/lib/apt/lists/*

# ---- Copy requirements and install dependencies ----
COPY requirements.txt .
RUN pip install --upgrade pip setuptools wheel && \
    pip install --no-cache-dir -r requirements.txt

# ---- Copy application code ----
COPY . .

# ---- Create directories with proper permissions ----
RUN mkdir -p /app/.files /app/.cache/huggingface /app/.chainlit && \
    chmod -R 777 /app

# ---- Expose port ----
EXPOSE 7860

# ---- Run application ----

CMD ["chainlit", "run", "app.py", "--host", "0.0.0.0", "--port", "7860", "--headless"]