Create Dockerfile
Browse files- Dockerfile +26 -0
Dockerfile
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Stage 1: Build
|
2 |
+
FROM python:3.11-slim as builder
|
3 |
+
|
4 |
+
WORKDIR /app
|
5 |
+
|
6 |
+
# Install git and unzip
|
7 |
+
RUN apt-get update && \
|
8 |
+
apt-get install -y --no-install-recommends git unzip && \
|
9 |
+
apt-get clean && \
|
10 |
+
rm -rf /var/lib/apt/lists/*
|
11 |
+
|
12 |
+
# Clone the public repository
|
13 |
+
RUN git clone https://github.com/exis000/HeartDiseasePredictor_Model.git /app/HeartDiseasePredictor_Model
|
14 |
+
|
15 |
+
# Set the working directory to the cloned repository
|
16 |
+
WORKDIR /app/HeartDiseasePredictor_Model
|
17 |
+
|
18 |
+
# Install Python dependencies
|
19 |
+
RUN pip install --upgrade pip && \
|
20 |
+
pip install -r requirements.txt
|
21 |
+
|
22 |
+
# Extract the RandomForest_best_model.zip file in the model folder
|
23 |
+
RUN unzip model/RandomForest_best_model.zip -d model/
|
24 |
+
|
25 |
+
# Run the main script
|
26 |
+
CMD ["python", "-m", "deployment.api.app"]
|