File size: 1,009 Bytes
3812afd
 
82fb0fd
3812afd
82fb0fd
81e6860
3812afd
 
82fb0fd
 
3812afd
 
 
 
e56ca8b
 
82fb0fd
5cc3483
 
e56ca8b
3812afd
 
 
 
82fb0fd
 
3812afd
 
82fb0fd
bc463fc
 
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
# Use a Python slim base image with necessary system dependencies
FROM python:3.10-slim

# Install system dependencies for pillow and general compatibility
RUN apt-get update && apt-get install -y \
    libpng-dev \
    libjpeg-dev \
    gcc \
    && rm -rf /var/lib/apt/lists/*

# Set working directory
WORKDIR /app

# Copy requirements and install dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy the Streamlit app file (in src directory)
COPY src/streamlit_app.py ./src/streamlit_app.py

# Create cache directory with write permissions
RUN mkdir -p /tmp/cache && chmod -R 777 /tmp/cache

# Expose Streamlit's default port
EXPOSE 8501

# Set environment variable for Hugging Face cache
ENV HUGGINGFACE_HUB_CACHE=/tmp/cache

# Run Streamlit with the correct file path, increased upload size, and disabled XSRF protection
CMD ["streamlit", "run", "src/streamlit_app.py", "--server.maxUploadSize=1000", "--server.port=8501", "--server.enableXsrfProtection=false"]