Spaces:
Sleeping
Sleeping
File size: 1,107 Bytes
ed0a0db 8f4ce98 e1690ae 303d838 77ec153 e1690ae 8f4ce98 303d838 8f4ce98 e1690ae 303d838 e1690ae 8f4ce98 303d838 8f4ce98 e1690ae 303d838 e1690ae |
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 |
FROM python:3.11-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 OS deps. (git optional but handy if you ever install from a repo)
RUN apt-get update && apt-get install -y --no-install-recommends \
curl ca-certificates git fonts-dejavu \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir -p /tmp/mplconfig
# Install Python deps
COPY requirements.txt .
# Install TA-Lib wheel explicitly first and fail fast if wheel isn't available
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
# Healthcheck to catch boot problems early
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.address=0.0.0.0 --server.port=${PORT}"] |