File size: 1,118 Bytes
7724ea4
2e38aeb
 
 
 
 
4966e6a
 
 
2e38aeb
 
 
4966e6a
dda0100
2e38aeb
 
dda0100
 
 
 
 
 
 
 
 
 
 
 
2e38aeb
4966e6a
2e38aeb
 
4966e6a
2e38aeb
 
4966e6a
dda0100
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
36
37
38
FROM python:3.10-slim-bookworm

ENV PYTHONDONTWRITEBYTECODE=1 \
    PYTHONUNBUFFERED=1 \
    PIP_NO_CACHE_DIR=1 \
    STREAMLIT_BROWSER_GATHER_USAGE_STATS=false

WORKDIR /app

RUN apt-get update && apt-get install -y --no-install-recommends \
    curl git ca-certificates \
 && rm -rf /var/lib/apt/lists/*

# Install deps
COPY requirements.txt .
RUN python -m pip install --upgrade pip \
 && pip install --no-cache-dir --prefer-binary -r requirements.txt \
 # sanity check: ensure the function exists so the build fails early
 && python - <<'PY'
import sys, vix_utils
print("python:", sys.version)
print("vix_utils path:", vix_utils.__file__)
print("vix_utils version:", getattr(vix_utils, "__version__", "unknown"))
assert hasattr(vix_utils, "async_load_vix_term_structure"), \
       "vix_utils missing async_load_vix_term_structure"
PY

# app code
COPY . .

ENV PORT=7860
EXPOSE 7860

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}"]