Spaces:
Sleeping
Sleeping
| FROM python:3.9-slim-bookworm | |
| ENV PYTHONDONTWRITEBYTECODE=1 \ | |
| PYTHONUNBUFFERED=1 \ | |
| PIP_NO_CACHE_DIR=1 \ | |
| STREAMLIT_BROWSER_GATHER_USAGE_STATS=false \ | |
| MPLBACKEND=Agg \ | |
| MPLCONFIGDIR=/tmp/mplconfig | |
| WORKDIR /app | |
| # Minimal system deps for matplotlib fonts/rendering (no compilers needed) | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| curl ca-certificates fonts-dejavu libfreetype6 libpng16-16 \ | |
| && rm -rf /var/lib/apt/lists/* \ | |
| && mkdir -p /tmp/mplconfig | |
| # Install Python deps | |
| COPY requirements.txt . | |
| RUN python -m pip install --upgrade pip setuptools wheel \ | |
| && pip install --no-cache-dir --only-binary=:all: "TA-Lib==0.6.5" \ | |
| && pip install --no-cache-dir -r requirements.txt | |
| # Your code | |
| COPY . . | |
| ENV PORT=7860 | |
| EXPOSE 7860 | |
| # (Optional) healthcheck | |
| HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 \ | |
| CMD curl --fail http://127.0.0.1:${PORT}/_stcore/health || exit 1 | |
| CMD ["sh","-c","streamlit run app.py --server.port=${PORT} --server.address=0.0.0.0"] | |