Skip to content

Commit b5a0cab

Browse files
committed
chore/security : rollback to slim image
1 parent d55cf02 commit b5a0cab

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

tools/chatbot/Dockerfile

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ COPY pyproject.toml uv.lock ./
2222
# Install dependencies
2323
RUN uv sync --frozen --no-dev
2424

25-
# Final stage - use hardened Debian-based image (not Alpine, for onnxruntime compatibility)
26-
FROM dhi.io/python:3.13
25+
# Final stage - use standard Debian slim (DHI too minimal for venv)
26+
FROM python:3.13-slim
2727

2828
# Set environment variables
2929
ENV PYTHONDONTWRITEBYTECODE=1 \
@@ -39,8 +39,12 @@ COPY --from=builder /app/.venv /app/.venv
3939
# Copy application code
4040
COPY . .
4141

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+
4246
# Run as non-root user
43-
USER 1000:1000
47+
USER chatbot
4448

45-
# Run the application using the virtual environment's Python (via PATH)
49+
# Run the application
4650
CMD ["python", "chatbot.py"]

0 commit comments

Comments
 (0)