forked from ziedtuihri/MLOps
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
23 lines (16 loc) · 675 Bytes
/
Dockerfile
File metadata and controls
23 lines (16 loc) · 675 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Use an official Python runtime as a parent image
FROM python:3.11-slim
# Set the working directory in the container
WORKDIR /app
# Copy the requirements file first to leverage Docker cache
COPY requirements.txt /app/
RUN pip install --no-cache-dir -r requirements.txt
# Copy the rest of the application code
COPY . /app
# Run main.py to generate model.pkl
RUN python3 main.py
# Expose ports
EXPOSE 5000 8000
# Use JSON format for CMD to prevent unintended behavior related to OS signals
CMD ["sh", "-c", "mlflow ui --host 0.0.0.0 --port 5000 & uvicorn app:app --host 0.0.0.0 --port 8000"]
# For production, consider using a process manager like supervisord or tini.