LeafScan / Dockerfile
A7md47's picture
Update Dockerfile
43cb028 verified
Raw
History Blame Contribute Delete
755 Bytes
# 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"]