Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,19 @@ jobs:
- name: Build
run: docker build -t candidate:ci ./services/api

- name: The image imports its app
# It carries no build tools (setuptools, wheel); prove the service needs none.
run: docker run --rm --entrypoint python candidate:ci -c "import app.main"

- name: Scan the image
# Trivy, pinned by digest: HIGH or CRITICAL problems that already have a fix fail here,
# before the image can be published.
run: |
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock \
aquasec/trivy:0.75.0@sha256:af6acf9a6b85dfe389a1941505c0ce9efef52a4719635e1a962f022a3d855daa \
image --quiet --scanners vuln --ignore-unfixed --severity HIGH,CRITICAL \
--exit-code 1 candidate:ci

- name: Search it for anything secret
run: |
found=$(docker run --rm --entrypoint sh candidate:ci -c \
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ a decision with visible consequences.

## Unreleased

## 0.5.1

- The image no longer carries the base image's setuptools and wheel. The service never
imports them, and their vendored copies had published advisories (wheel 0.45.1,
jaraco.context 5.3.0) that the new image scan found. CI now checks that the built image
still imports its app.

## 0.5.0

- Honor a message from the owner that starts "remember that ..." or "don't remember ..."
Expand Down
5 changes: 4 additions & 1 deletion dashboard/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ RUN npm run build

FROM python:3.11-slim
WORKDIR /app
RUN pip install --no-cache-dir fastapi==0.138.2 uvicorn==0.49.0
# The base image's setuptools and wheel are build tools the service never imports; removing
# them keeps their vendored copies (and their advisories) out of the running image.
RUN pip install --no-cache-dir fastapi==0.138.2 uvicorn==0.49.0 \
&& pip uninstall --yes setuptools wheel
COPY server.py ./server.py
COPY --from=build /app/dist ./dist
EXPOSE 8021
Expand Down
5 changes: 4 additions & 1 deletion services/api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ FROM python:3.11-slim
WORKDIR /app
ENV PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# The base image's setuptools and wheel are build tools the service never imports; removing
# them keeps their vendored copies (and their advisories) out of the running image.
RUN pip install --no-cache-dir -r requirements.txt \
&& pip uninstall --yes setuptools wheel
COPY app ./app
EXPOSE 8020
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8020"]
2 changes: 1 addition & 1 deletion services/api/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

log = logging.getLogger("memorygate")

SERVICE_VERSION = "0.5.0"
SERVICE_VERSION = "0.5.1"

app = FastAPI(title="MemoryGate", version=SERVICE_VERSION)

Expand Down
Loading