Update Dockerfile
Browse files- Dockerfile +6 -7
Dockerfile
CHANGED
@@ -3,9 +3,9 @@ FROM python:3.11-slim as builder
|
|
3 |
|
4 |
WORKDIR /app
|
5 |
|
6 |
-
# Install git
|
7 |
RUN apt-get update && \
|
8 |
-
apt-get install -y --no-install-recommends git
|
9 |
apt-get clean && \
|
10 |
rm -rf /var/lib/apt/lists/*
|
11 |
|
@@ -18,13 +18,12 @@ WORKDIR /app/HeartDiseasePredictor_Model
|
|
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 |
-
|
25 |
-
|
26 |
-
|
27 |
-
unzip RandomForest_best_model.zip; \
|
28 |
else \
|
29 |
echo "ERROR: RandomForest_best_model.zip not found in the model folder."; \
|
30 |
exit 1; \
|
|
|
3 |
|
4 |
WORKDIR /app
|
5 |
|
6 |
+
# Install git
|
7 |
RUN apt-get update && \
|
8 |
+
apt-get install -y --no-install-recommends git && \
|
9 |
apt-get clean && \
|
10 |
rm -rf /var/lib/apt/lists/*
|
11 |
|
|
|
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 using Python
|
22 |
RUN if [ -d "model" ]; then \
|
23 |
echo "Model folder found."; \
|
24 |
+
if [ -f "model/RandomForest_best_model.zip" ]; then \
|
25 |
+
echo "RandomForest_best_model.zip found. Extracting using Python..."; \
|
26 |
+
python -c "import zipfile; zipfile.ZipFile('model/RandomForest_best_model.zip', 'r').extractall('model/')"; \
|
|
|
27 |
else \
|
28 |
echo "ERROR: RandomForest_best_model.zip not found in the model folder."; \
|
29 |
exit 1; \
|