Skip to content

Commit e2b2ec2

Browse files
authored
Merge pull request #48 from Azure-Samples/enchen/vulnarability
Fix vulnerability issue
2 parents 17ff3aa + 5bac33b commit e2b2ec2

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

server/Dockerfile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ ENV UV_LINK_MODE=copy \
1414

1515
WORKDIR /app
1616

17-
# Create virtual environment
18-
RUN python -m venv /app/.venv
17+
# Create virtual environment (without pip — uv handles installs)
18+
RUN python -m venv --without-pip /app/.venv
1919

2020
# Copy dependency files first for better layer caching
2121
COPY pyproject.toml uv.lock /app/
@@ -32,11 +32,11 @@ COPY static /app/static/
3232
###############
3333
FROM python:3.12-slim-bookworm
3434

35-
# Patch system packages
36-
RUN apt-get update && apt-get upgrade -y && rm -rf /var/lib/apt/lists/*
37-
38-
# Upgrade system pip (fixes GHSA-jp4c-xjxw-mgf9)
39-
RUN pip install --no-cache-dir --upgrade pip>=26.1
35+
# Patch system packages and strip pip/setuptools (not needed at runtime)
36+
RUN apt-get update && apt-get upgrade -y && rm -rf /var/lib/apt/lists/* && \
37+
rm -rf /usr/local/lib/python3.12/dist-packages/pip* \
38+
/usr/local/lib/python3.12/dist-packages/setuptools* \
39+
/usr/local/bin/pip*
4040

4141
# Create non-root user
4242
RUN groupadd -r app && useradd -r -d /app -g app -N app

0 commit comments

Comments
 (0)