File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,8 +22,8 @@ COPY pyproject.toml uv.lock ./
2222# Install dependencies
2323RUN 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
2929ENV PYTHONDONTWRITEBYTECODE=1 \
@@ -39,8 +39,12 @@ COPY --from=builder /app/.venv /app/.venv
3939# Copy application code
4040COPY . .
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
4650CMD ["python" , "chatbot.py" ]
You can’t perform that action at this time.
0 commit comments