|
|
|
FROM python:3.11-slim as builder |
|
|
|
WORKDIR /app |
|
|
|
|
|
RUN apt-get update && \ |
|
apt-get install -y --no-install-recommends git && \ |
|
apt-get clean && \ |
|
rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
RUN git clone https://github.com/exis000/HeartDiseasePredictor_Model.git /app/HeartDiseasePredictor_Model |
|
|
|
|
|
WORKDIR /app/HeartDiseasePredictor_Model |
|
|
|
|
|
RUN ls -R |
|
|
|
|
|
RUN if [ -d "model" ]; then \ |
|
echo "Model folder found."; \ |
|
if [ -f "model/RandomForest_best_model.zip" ]; then \ |
|
echo "RandomForest_best_model.zip found. Extracting using Python..."; \ |
|
python -c "import zipfile; zipfile.ZipFile('model/RandomForest_best_model.zip', 'r').extractall('model/')"; \ |
|
else \ |
|
echo "ERROR: RandomForest_best_model.zip not found in the model folder."; \ |
|
exit 1; \ |
|
fi; \ |
|
else \ |
|
echo "ERROR: Model folder not found."; \ |
|
exit 1; \ |
|
fi |
|
|
|
|
|
RUN pip install --upgrade pip && \ |
|
pip install -r requirements.txt |
|
|
|
|
|
CMD ["python", "-m", "deployment.Api.app"] |