QuantumLearner commited on
Commit
54dbef8
·
verified ·
1 Parent(s): 0def5df

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -12
Dockerfile CHANGED
@@ -10,12 +10,12 @@ ENV DEBIAN_FRONTEND=noninteractive \
10
 
11
  WORKDIR /app
12
 
13
- # System deps (compiler toolchain + fetch tools)
14
  RUN apt-get update && apt-get install -y --no-install-recommends \
15
- build-essential curl wget ca-certificates \
16
  && rm -rf /var/lib/apt/lists/*
17
 
18
- # ---- Build & install TA-Lib C library (serial make to avoid race) ----
19
  RUN set -eux; \
20
  wget -O ta-lib-0.4.0-src.tar.gz "http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz"; \
21
  tar -xzf ta-lib-0.4.0-src.tar.gz; \
@@ -28,21 +28,20 @@ RUN set -eux; \
28
  rm -rf "${TL_DIR}" ta-lib-0.4.0-src.tar.gz; \
29
  ldconfig
30
 
31
- # Python deps
32
  RUN python -m pip install --upgrade pip
33
 
34
- COPY requirements.txt ./
35
-
36
- # 1) Ensure NumPy 1.26.x headers are present for the TA-Lib build
37
- RUN pip install --no-cache-dir --prefer-binary "numpy==1.26.4"
38
 
39
- # 2) Build/install the Python wrapper WITHOUT build isolation (uses the NumPy we just installed)
40
  RUN pip install --no-cache-dir --prefer-binary --no-build-isolation "TA-Lib==0.4.24"
41
 
42
- # 3) Install the rest (TA-Lib already satisfied; keep your numpy<2 pin in requirements)
 
43
  RUN pip install --no-cache-dir --prefer-binary -r requirements.txt
44
 
45
- # Your code
46
  COPY . .
47
 
48
  ENV PORT=7860
@@ -51,4 +50,4 @@ EXPOSE 7860
51
  HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 \
52
  CMD curl --fail http://127.0.0.1:${PORT}/_stcore/health || exit 1
53
 
54
- CMD ["sh", "-c", "streamlit run app.py --server.address=0.0.0.0 --server.port=${PORT} --server.headless=true"]
 
10
 
11
  WORKDIR /app
12
 
13
+ # Toolchain & fetch tools
14
  RUN apt-get update && apt-get install -y --no-install-recommends \
15
+ build-essential wget curl ca-certificates \
16
  && rm -rf /var/lib/apt/lists/*
17
 
18
+ # ---------- Build & install TA-Lib C library (NO parallel make) ----------
19
  RUN set -eux; \
20
  wget -O ta-lib-0.4.0-src.tar.gz "http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz"; \
21
  tar -xzf ta-lib-0.4.0-src.tar.gz; \
 
28
  rm -rf "${TL_DIR}" ta-lib-0.4.0-src.tar.gz; \
29
  ldconfig
30
 
31
+ # Python bootstrap
32
  RUN python -m pip install --upgrade pip
33
 
34
+ # Install headers needed for TA-Lib Python build (must be in the SAME env)
35
+ RUN pip install --no-cache-dir "numpy==1.26.4" "Cython==0.29.36" "setuptools<75"
 
 
36
 
37
+ # Build the TA-Lib Python wrapper USING the env’s Cython (regenerates code for Py3.11)
38
  RUN pip install --no-cache-dir --prefer-binary --no-build-isolation "TA-Lib==0.4.24"
39
 
40
+ # Rest of your deps
41
+ COPY requirements.txt ./
42
  RUN pip install --no-cache-dir --prefer-binary -r requirements.txt
43
 
44
+ # App
45
  COPY . .
46
 
47
  ENV PORT=7860
 
50
  HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 \
51
  CMD curl --fail http://127.0.0.1:${PORT}/_stcore/health || exit 1
52
 
53
+ CMD ["sh", "-c", "streamlit run app.py --server.address=0.0.0.0 --server.port=${PORT} --server.headless=true"]