Skip to content

Commit 24c7ac4

Browse files
committed
Integrate changes from #213
Signed-off-by: Samuel Monson <[email protected]>
1 parent d0e7b0b commit 24c7ac4

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

deploy/Containerfile

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
ARG PYTHON=3.13
1+
ARG BASE_IMAGE=docker.io/python:3.13-slim
22

33
# Use a multi-stage build to create a lightweight production image
4-
FROM docker.io/python:${PYTHON}-slim as builder
4+
FROM $BASE_IMAGE as builder
5+
6+
# Ensure files are installed as root
7+
USER root
58

69
# Copy repository files
7-
COPY / /src
10+
COPY / /opt/app-root/src
811

912
# Create a venv and install guidellm
10-
RUN python3 -m venv /opt/guidellm \
11-
&& /opt/guidellm/bin/pip install --no-cache-dir /src
12-
13-
# Copy entrypoint script into the venv bin directory
14-
RUN install -m0755 /src/deploy/entrypoint.sh /opt/guidellm/bin/entrypoint.sh
13+
RUN python3 -m venv /opt/app-root/guidellm \
14+
&& /opt/app-root/guidellm/bin/pip install --no-cache-dir /opt/app-root/src
1515

1616
# Prod image
17-
FROM docker.io/python:${PYTHON}-slim
17+
FROM $BASE_IMAGE
1818

1919
# Copy the virtual environment from the builder stage
20-
COPY --from=builder /opt/guidellm /opt/guidellm
20+
COPY --from=builder /opt/app-root/guidellm /opt/app-root/guidellm
2121

2222
# Add guidellm bin to PATH
23-
ENV PATH="/opt/guidellm/bin:$PATH"
23+
ENV PATH="/opt/app-root/guidellm/bin:$PATH"
2424

2525
# Create a non-root user
2626
RUN useradd -md /results guidellm
@@ -45,4 +45,5 @@ ENV GUIDELLM_TARGET="http://localhost:8000" \
4545
GUIDELLM_MAX_SECONDS="" \
4646
GUIDELLM_OUTPUT_PATH="/results/results.json"
4747

48-
ENTRYPOINT [ "/opt/guidellm/bin/guidellm" ]
48+
ENTRYPOINT [ "/opt/app-root/guidellm/bin/guidellm" ]
49+
CMD [ "benchmark", "run" ]

0 commit comments

Comments
 (0)