-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (23 loc) · 906 Bytes
/
Dockerfile
File metadata and controls
33 lines (23 loc) · 906 Bytes
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
# Use an official Python runtime as a parent image
FROM python:3.10-slim
# Set environment variables to prevent Python from buffering stdout/stderr
ENV PYTHONUNBUFFERED=1
# Install curl and needed dependencies
RUN apt-get update && apt-get install -y curl
# Install uv
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
# Add uv to PATH
ENV PATH="/root/.local/bin:$PATH"
# Set the working directory in the container
WORKDIR /app
# Copy the local script into the container
COPY . /app
# Install dependencies using uv
RUN uv venv
RUN . .venv/bin/activate && uv pip install -e .
ARG BUILD_COMMIT="unknown"
ARG BUILD_BRANCH="main"
ENV BUILD_COMMIT=${BUILD_COMMIT} \
BUILD_BRANCH=${BUILD_BRANCH}
# Ensure the virtual environment is activated and start the server
CMD ["/app/.venv/bin/python", "-m", "uvicorn", "src.ml_pipelines_kfp.iris_xgboost.server:app", "--host", "0.0.0.0", "--port", "8080"]