SilentWraith's picture
Update Dockerfile
d88dd2f verified
raw
history blame
1.24 kB
# 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
# Print all files in the repository for debugging
RUN ls -R
# Ensure the model folder exists and extract the zip file
RUN if [ -d "model" ]; then \
echo "Model folder found."; \
cd model && \
if [ -f "RandomForest_best_model.zip" ]; then \
echo "RandomForest_best_model.zip found. Extracting..."; \
unzip RandomForest_best_model.zip; \
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
# Install Python dependencies
RUN pip install --upgrade pip && \
pip install -r requirements.txt
# Run the main script
CMD ["python", "-m", "deployment.Api.app"]