File size: 722 Bytes
01fc1b7
585fd8e
a10ad06
01fc1b7
 
05fd864
01fc1b7
585fd8e
 
a10ad06
01fc1b7
 
585fd8e
a10ad06
59e80a0
a10ad06
 
 
 
 
 
ee87bb6
585fd8e
d8f06bf
ee87bb6
a10ad06
 
 
 
585fd8e
01fc1b7
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
FROM python:3.10-slim

# Install git (Hugging Face sometimes uses it for custom code)
RUN apt-get update && \
    apt-get install -y git && \
    rm -rf /var/lib/apt/lists/*

WORKDIR /app

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

# βœ… Create a safe writable cache folder
RUN mkdir -p /app/hf_cache && chmod -R 777 /app/hf_cache

# βœ… Point HF + Transformers cache to that folder
ENV HF_HOME=/app/hf_cache
ENV TRANSFORMERS_CACHE=/app/hf_cache

# Copy your Streamlit app
COPY app.py .

EXPOSE 8501

# Streamlit config
ENV STREAMLIT_SERVER_HEADLESS=true
ENV STREAMLIT_SERVER_PORT=8501
ENV STREAMLIT_SERVER_ADDRESS=0.0.0.0

CMD ["streamlit", "run", "app.py"]