Update Dockerfile
Browse files- Dockerfile +17 -4
Dockerfile
CHANGED
|
@@ -18,12 +18,25 @@ WORKDIR /app/HeartDiseasePredictor_Model
|
|
| 18 |
# Print all files in the repository for debugging
|
| 19 |
RUN ls -R
|
| 20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
# Install Python dependencies
|
| 22 |
RUN pip install --upgrade pip && \
|
| 23 |
pip install -r requirements.txt
|
| 24 |
|
| 25 |
-
# Extract the RandomForest_best_model.zip file in the model folder
|
| 26 |
-
RUN unzip model/RandomForest_best_model.zip -d model/
|
| 27 |
-
|
| 28 |
# Run the main script
|
| 29 |
-
CMD ["python", "-m", "deployment.
|
|
|
|
| 18 |
# Print all files in the repository for debugging
|
| 19 |
RUN ls -R
|
| 20 |
|
| 21 |
+
# Ensure the model folder exists and extract the zip file
|
| 22 |
+
RUN if [ -d "model" ]; then \
|
| 23 |
+
echo "Model folder found."; \
|
| 24 |
+
cd model && \
|
| 25 |
+
if [ -f "RandomForest_best_model.zip" ]; then \
|
| 26 |
+
echo "RandomForest_best_model.zip found. Extracting..."; \
|
| 27 |
+
unzip RandomForest_best_model.zip; \
|
| 28 |
+
else \
|
| 29 |
+
echo "ERROR: RandomForest_best_model.zip not found in the model folder."; \
|
| 30 |
+
exit 1; \
|
| 31 |
+
fi; \
|
| 32 |
+
else \
|
| 33 |
+
echo "ERROR: Model folder not found."; \
|
| 34 |
+
exit 1; \
|
| 35 |
+
fi
|
| 36 |
+
|
| 37 |
# Install Python dependencies
|
| 38 |
RUN pip install --upgrade pip && \
|
| 39 |
pip install -r requirements.txt
|
| 40 |
|
|
|
|
|
|
|
|
|
|
| 41 |
# Run the main script
|
| 42 |
+
CMD ["python", "-m", "deployment.Api.app"]
|