-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
34 lines (26 loc) · 799 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Use the official Python image.
FROM python:3.12-slim
# Install build dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
gcc \
g++ \
make \
libffi-dev \
libssl-dev \
&& rm -rf /var/lib/apt/lists/*
# Set the working directory
WORKDIR /app
# Copy the requirements file first to leverage Docker cache
COPY requirements.txt ./
# Install dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy the entire project directory to the container
COPY . .
# Expose the port on which your service will run
EXPOSE 5002
# Set environment variables
ENV MODEL_PATH=/app/models/model_xgboost.bin
ENV DV_PATH=/app/models/dv.bin
# Command to run the Flask app with Gunicorn
CMD ["gunicorn", "-b", "0.0.0.0:5002", "scripts.predict:app"]