# Use an official Python runtime as a parent image FROM python:3.9-slim # Set the working directory in the container WORKDIR /app # Install system dependencies required for TA-Lib and other packages RUN apt-get update && apt-get install -y \ build-essential \ wget \ unzip \ && rm -rf /var/lib/apt/lists/* # Download and install TA-Lib RUN wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz && \ tar -xzf 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 into the container COPY requirements.txt . # Install any needed packages specified in requirements.txt RUN pip install --no-cache-dir -r requirements.txt # Copy the rest of the application's code into the container COPY . . # Make port 8000 available to the world outside this container EXPOSE 8000 # Define environment variable ENV NAME World # Run app.py when the container launches CMD ["gunicorn", "--bind", "0.0.0.0:8000", "app:app"]