QuantumLearner commited on
Commit
dda0100
·
verified ·
1 Parent(s): 1679da6

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +15 -8
Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- FROM python:3.9-slim-bookworm
2
 
3
  ENV PYTHONDONTWRITEBYTECODE=1 \
4
  PYTHONUNBUFFERED=1 \
@@ -7,24 +7,31 @@ ENV PYTHONDONTWRITEBYTECODE=1 \
7
 
8
  WORKDIR /app
9
 
10
- # system deps (keep minimal; drop build-essential if not building wheels)
11
  RUN apt-get update && apt-get install -y --no-install-recommends \
12
  curl git ca-certificates \
13
  && rm -rf /var/lib/apt/lists/*
14
 
15
- # python deps (better cache behavior)
16
  COPY requirements.txt .
17
  RUN python -m pip install --upgrade pip \
18
- && pip install --no-cache-dir --prefer-binary -r requirements.txt
19
-
20
- # your code
 
 
 
 
 
 
 
 
 
21
  COPY . .
22
 
23
  ENV PORT=7860
24
  EXPOSE 7860
25
 
26
- # healthcheck helps detect boot issues
27
  HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 \
28
  CMD curl --fail http://127.0.0.1:${PORT}/_stcore/health || exit 1
29
 
30
- CMD ["sh", "-c", "streamlit run app.py --server.address=0.0.0.0 --server.port=${PORT}"]
 
1
+ FROM python:3.11-slim-bookworm
2
 
3
  ENV PYTHONDONTWRITEBYTECODE=1 \
4
  PYTHONUNBUFFERED=1 \
 
7
 
8
  WORKDIR /app
9
 
 
10
  RUN apt-get update && apt-get install -y --no-install-recommends \
11
  curl git ca-certificates \
12
  && rm -rf /var/lib/apt/lists/*
13
 
14
+ # Install deps
15
  COPY requirements.txt .
16
  RUN python -m pip install --upgrade pip \
17
+ && pip install --no-cache-dir --prefer-binary -r requirements.txt \
18
+ # sanity check: ensure the function exists so the build fails early
19
+ && python - <<'PY'
20
+ import sys, vix_utils
21
+ print("python:", sys.version)
22
+ print("vix_utils path:", vix_utils.__file__)
23
+ print("vix_utils version:", getattr(vix_utils, "__version__", "unknown"))
24
+ assert hasattr(vix_utils, "async_load_vix_term_structure"), \
25
+ "vix_utils missing async_load_vix_term_structure"
26
+ PY
27
+
28
+ # app code
29
  COPY . .
30
 
31
  ENV PORT=7860
32
  EXPOSE 7860
33
 
 
34
  HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 \
35
  CMD curl --fail http://127.0.0.1:${PORT}/_stcore/health || exit 1
36
 
37
+ CMD ["sh", "-c", "streamlit run app.py --server.address=0.0.0.0 --server.port=${PORT}"]