diff --git a/Dockerfile b/Dockerfile index b88f07b..5bbab11 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +1,19 @@ +# Use Alpine for a smaller image FROM python:3.11-alpine +# Set working directory WORKDIR /app +# Install build dependencies for TA-Lib RUN apk add --no-cache \ build-base \ wget \ tar \ bash \ - libffi-dev \ - && wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz \ + libffi-dev + +# Download, extract, and compile TA-Lib (ARM compatible) +RUN wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz \ && tar -xvzf ta-lib-0.4.0-src.tar.gz \ && cd ta-lib \ && ./configure --prefix=/usr \ @@ -17,10 +22,17 @@ RUN apk add --no-cache \ && cd .. \ && rm -rf ta-lib ta-lib-0.4.0-src.tar.gz +# Copy the requirements file first (for caching layers) COPY requirements.txt . + +# Install Python dependencies, including `ta-lib` RUN pip install --no-cache-dir -r requirements.txt + +# Copy the rest of the project COPY . . +# Expose Streamlit's default port EXPOSE 8501 +# Run Streamlit in headless mode CMD ["streamlit", "run", "src/streamlit_app.py", "--server.headless=true", "--server.port=8501"] \ No newline at end of file