Skip to content

Commit 261ff0e

Browse files
committed
wip(chatbot): attempt to use DHI images
1 parent b64c353 commit 261ff0e

File tree

1 file changed

+6
-17
lines changed

1 file changed

+6
-17
lines changed

tools/chatbot/Dockerfile

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
11
# Builder stage - use Debian Python image for building (onnxruntime needs glibc/manylinux)
2-
FROM python:3.13-slim AS builder
2+
FROM dhi.io/python:3.13-dev AS builder
3+
4+
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
35

46
# Set environment variables
57
ENV PYTHONDONTWRITEBYTECODE=1 \
68
PYTHONUNBUFFERED=1 \
79
UV_CACHE_DIR=/tmp/uv-cache \
810
UV_LINK_MODE=copy
911

10-
# Install build dependencies
11-
RUN apt-get update && apt-get install -y --no-install-recommends curl ca-certificates && \
12-
curl -LsSf https://astral.sh/uv/install.sh | sh && \
13-
mv /root/.local/bin/uv /usr/local/bin/uv && \
14-
rm -rf /var/lib/apt/lists/*
15-
1612
# Set the working directory
1713
WORKDIR /app
1814

@@ -23,7 +19,7 @@ COPY pyproject.toml uv.lock ./
2319
RUN uv sync --frozen --no-dev
2420

2521
# Final stage - use standard Debian slim (DHI too minimal for venv)
26-
FROM python:3.13-slim
22+
FROM dhi.io/python:3.13
2723

2824
# Set environment variables
2925
ENV PYTHONDONTWRITEBYTECODE=1 \
@@ -34,17 +30,10 @@ ENV PYTHONDONTWRITEBYTECODE=1 \
3430
WORKDIR /app
3531

3632
# Copy virtual environment from builder
37-
COPY --from=builder /app/.venv /app/.venv
33+
COPY --from=builder --chown=1000:1000 /app/.venv /app/.venv
3834

3935
# Copy application code
40-
COPY . .
41-
42-
# Create non-root user
43-
RUN groupadd -r -g 1000 chatbot && useradd -r -u 1000 -g chatbot chatbot && \
44-
chown -R chatbot:chatbot /app
45-
46-
# Run as non-root user
47-
USER chatbot
36+
COPY chatbot.py chatbot.py
4837

4938
# Run the application
5039
CMD ["python", "chatbot.py"]

0 commit comments

Comments
 (0)