prefero / Dockerfile
Wil2200's picture
Dockerfile: add git and curl for HF Spaces dev mode compatibility
4b50f68
Raw
History Blame Contribute Delete
830 Bytes
FROM python:3.11-slim
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
git \
curl \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements first for caching
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy project files
COPY src/ src/
COPY app/ app/
COPY data/ data/
COPY .streamlit/ .streamlit/
COPY pyproject.toml .
# Install the package
RUN pip install --no-cache-dir -e .
# Expose Streamlit port
EXPOSE 7860
# Health check
HEALTHCHECK CMD curl --fail http://localhost:7860/_stcore/health || exit 1
# Run Streamlit
CMD ["streamlit", "run", "app/Home.py", \
"--server.port=7860", \
"--server.address=0.0.0.0", \
"--server.headless=true", \
"--browser.gatherUsageStats=false"]