eligapris commited on
Commit
a3c4558
·
verified ·
1 Parent(s): ef862b4

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -10
Dockerfile CHANGED
@@ -1,6 +1,6 @@
1
  FROM python:3.9
2
 
3
- # Install system dependencies for TA-Lib
4
  RUN apt-get update && apt-get install -y \
5
  build-essential \
6
  wget \
@@ -9,29 +9,32 @@ RUN apt-get update && apt-get install -y \
9
  # Download and install TA-Lib C library
10
  RUN wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz && \
11
  tar -xzf ta-lib-0.4.0-src.tar.gz && \
12
- cd ta-lib/ && \
13
- ./configure --prefix=/usr && \
14
  make && \
15
  make install && \
16
  cd .. && \
17
  rm -rf ta-lib ta-lib-0.4.0-src.tar.gz
18
 
 
 
 
 
 
19
  # Set working directory
20
  WORKDIR /app
21
 
22
- # Install dependencies in the correct order for compatibility
23
  RUN pip install --upgrade pip
24
- RUN pip install "numpy>=2.0.0"
25
- RUN pip install "TA-Lib>=0.5.0"
26
-
27
- # Install other dependencies
28
  RUN pip install fastapi==0.104.1 uvicorn[standard]==0.24.0 pydantic==2.5.0 yfinance==0.2.28 requests==2.31.0
29
 
30
  # Copy application code
31
  COPY . .
32
 
33
  # Expose port
34
- EXPOSE 7680
35
 
36
  # Run the application
37
- CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7680", "--reload"]
 
1
  FROM python:3.9
2
 
3
+ # Install system dependencies
4
  RUN apt-get update && apt-get install -y \
5
  build-essential \
6
  wget \
 
9
  # Download and install TA-Lib C library
10
  RUN wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz && \
11
  tar -xzf ta-lib-0.4.0-src.tar.gz && \
12
+ cd ta-lib && \
13
+ ./configure --prefix=/usr/local && \
14
  make && \
15
  make install && \
16
  cd .. && \
17
  rm -rf ta-lib ta-lib-0.4.0-src.tar.gz
18
 
19
+ # Set environment so linker can find ta-lib
20
+ ENV LD_LIBRARY_PATH=/usr/local/lib
21
+ ENV CFLAGS="-I/usr/local/include"
22
+ ENV LDFLAGS="-L/usr/local/lib"
23
+
24
  # Set working directory
25
  WORKDIR /app
26
 
27
+ # Install Python dependencies
28
  RUN pip install --upgrade pip
29
+ RUN pip install numpy==1.26.4
30
+ RUN pip install TA-Lib==0.4.28 # latest version known to work well
 
 
31
  RUN pip install fastapi==0.104.1 uvicorn[standard]==0.24.0 pydantic==2.5.0 yfinance==0.2.28 requests==2.31.0
32
 
33
  # Copy application code
34
  COPY . .
35
 
36
  # Expose port
37
+ EXPOSE 8000
38
 
39
  # Run the application
40
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]