forked from sgl-project/genai-bench
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (31 loc) · 1.02 KB
/
Copy pathDockerfile
File metadata and controls
38 lines (31 loc) · 1.02 KB
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
35
36
37
38
# Use the official Python 3.11 slim image from Docker Hub
FROM python:3.11-slim
# Set the working directory in the container
WORKDIR /genai-bench
ENV PATH="/root/.local/bin:${PATH}"
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
wget \
curl \
gcc \
git \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Install pipx and uv using pip
RUN pip install --upgrade pip pipx hatchling wheel && \
pipx ensurepath && \
pipx install uv && \
rm -rf /root/.cache
# Copy the application code to the working directory
COPY . .
# Install the project and dependencies using uv
ARG PKG_VERSION
RUN echo "Installing version:${PKG_VERSION}" && \
uv version ${PKG_VERSION} && \
uv pip install --system -vvv . && \
rm -rf /root/.cache
# Clean up unnecessary files to reduce the image size
RUN apt-get clean && \
rm -rf /var/lib/apt/lists/* /var/cache/apt/* /var/log/*
# start poetry shell to activate the virtual environment
ENTRYPOINT ["genai-bench"]