# Stage 1: Build | |
FROM python:3.11-slim as builder | |
WORKDIR /app | |
# Install git and unzip | |
RUN apt-get update && \ | |
apt-get install -y --no-install-recommends git unzip && \ | |
apt-get clean && \ | |
rm -rf /var/lib/apt/lists/* | |
# Clone the public repository | |
RUN git clone https://github.com/exis000/HeartDiseasePredictor_Model.git /app/HeartDiseasePredictor_Model | |
# Set the working directory to the cloned repository | |
WORKDIR /app/HeartDiseasePredictor_Model | |
# Install Python dependencies | |
RUN pip install --upgrade pip && \ | |
pip install -r requirements.txt | |
# Extract the RandomForest_best_model.zip file in the model folder | |
RUN unzip model/RandomForest_best_model.zip -d model/ | |
# Run the main script | |
CMD ["python", "-m", "deployment.api.app"] |