File size: 1,156 Bytes
4ba17b3
 
3f70259
 
 
 
 
4ba17b3
 
3f70259
 
4ba17b3
 
3f70259
 
 
 
 
 
 
4ba17b3
3f70259
4ba17b3
3f70259
4ba17b3
3f70259
 
4ba17b3
3f70259
4ba17b3
 
3f70259
 
4ba17b3
3f70259
 
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
FROM python:3.9-slim

# Optional: speed up pip & keep image small
ENV PIP_NO_CACHE_DIR=1 \
    PIP_DISABLE_PIP_VERSION_CHECK=1 \
    STREAMLIT_BROWSER_GATHER_USAGE_STATS=false

WORKDIR /app

# Minimal, Debian-safe packages (no software-properties-common on Debian)
RUN apt-get update && apt-get install -y --no-install-recommends \
    build-essential \
    curl \
    ca-certificates \
 && rm -rf /var/lib/apt/lists/*

# If you use OpenCV or video/image I/O at runtime, uncomment these:
# RUN apt-get update && apt-get install -y --no-install-recommends \
#     ffmpeg libsm6 libxext6 libgl1 \
#  && rm -rf /var/lib/apt/lists/*

# Install deps first for better Docker layer caching
COPY requirements.txt ./
RUN pip install -r requirements.txt

# App code
COPY src/ ./src/

# Expose is informational; HF Spaces sets $PORT
EXPOSE 8501

# Streamlit health endpoint (optional on HF; keep curl installed)
HEALTHCHECK CMD curl --fail http://localhost:${PORT:-8501}/_stcore/health || exit 1

# Use a shell form so $PORT expands correctly on HF Spaces
CMD ["bash", "-lc", "streamlit run src/streamlit_app.py --server.port=${PORT:-8501} --server.address=0.0.0.0"]