making docker multi arch support

This commit is contained in:
Bobby 2025-02-20 21:54:20 -08:00
parent ae34a80301
commit 8dbf51107f

View File

@ -1,38 +1,15 @@
# Use Alpine for a smaller image FROM python:3.11-slim
FROM python:3.11-alpine
# Set working directory
WORKDIR /app WORKDIR /app
# Install build dependencies for TA-Lib RUN apt-get update && apt-get install -y \
RUN apk add --no-cache \ build-essential \
build-base \ libta-lib-dev \
wget \ && rm -rf /var/lib/apt/lists/*
tar \
bash \
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 \
&& make \
&& make install \
&& cd .. \
&& rm -rf ta-lib ta-lib-0.4.0-src.tar.gz
# Copy the requirements file first (for caching layers)
COPY requirements.txt . COPY requirements.txt .
# Install Python dependencies, including `ta-lib`
RUN pip install --no-cache-dir -r requirements.txt RUN pip install --no-cache-dir -r requirements.txt
# Copy the rest of the project
COPY . . COPY . .
# Expose Streamlit's default port
EXPOSE 8501 EXPOSE 8501
# Run Streamlit in headless mode
CMD ["streamlit", "run", "src/streamlit_app.py", "--server.headless=true", "--server.port=8501"] CMD ["streamlit", "run", "src/streamlit_app.py", "--server.headless=true", "--server.port=8501"]