File size: 755 Bytes
edcecf6 43cb028 edcecf6 50dcdf1 43cb028 | 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 | # Use lightweight Python image
FROM python:3.11-slim
# Prevent Python from buffering logs
ENV PYTHONUNBUFFERED=1
# Set working directory
WORKDIR /app
# Install system dependencies (needed for TensorFlow/Pillow sometimes)
RUN apt-get update && apt-get install -y \
build-essential \
libglib2.0-0 \
libsm6 \
libxext6 \
libxrender-dev \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements first (for caching)
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy all files
COPY . .
# Run Streamlit app with XSRF disabled (required for HF Spaces)
CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0", "--server.enableXsrfProtection=false"]
|