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
2 changes: 1 addition & 1 deletion .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
branches: [ master ]

env:
PYTHON_VERSION: 3.12
PYTHON_VERSION: 3.13.3

jobs:
lint:
Expand Down
24 changes: 13 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,31 +1,33 @@
# - Stage 1: Build dependencies into wheels ------------------------------------

FROM python:3.12-slim-bookworm AS build
FROM python:3.13.3-slim-bookworm AS build

WORKDIR /app

# Install system build tools needed to compile Python packages with native
# extensions
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential gcc && \
rm -rf /var/lib/apt/lists/*
# extensions, and clean up afterward to reduce image size.
RUN apt-get update && \

Check warning on line 9 in Dockerfile

View check run for this annotation

Codeac.io / Codeac Code Quality

DL3008

Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>`
apt-get install -y --no-install-recommends build-essential gcc libffi-dev libssl-dev && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /var/cache/apt/archives/*.deb

# Pre-build all third-party dependencies into wheel files. This enables faster,
# more reliable installation later without relying on network access
# more reliable installation later without relying on network access.
COPY requirements.txt .
RUN pip wheel --no-cache-dir --wheel-dir=/app/wheelhouse -r requirements.txt

# - Stage 2: Runtime image ----------------------------------------------------
# - Stage 2: Runtime image ----------------------------------------------------

FROM python:3.12-slim-bookworm AS runtime
FROM python:3.13.3-slim-bookworm AS runtime

WORKDIR /app

# Install dependencies from prebuilt wheels (no network access)
# This improves build speed and avoids dependency drift
# Install runtime dependencies from prebuilt wheels (no network access).
# This improves build speed and avoids dependency drift.
COPY requirements.txt .
COPY --from=build /app/wheelhouse /app/wheelhouse
RUN pip install --no-cache-dir --no-index --find-links /app/wheelhouse -r requirements.txt
RUN pip install --no-cache-dir --no-index --find-links /app/wheelhouse -r requirements.txt && \
rm -rf /app/wheelhouse

# Copy only runtime-relevant application code (excluding tests and tooling)
COPY models ./models
Expand Down
2 changes: 1 addition & 1 deletion runtime.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
python-3.12
python-3.13.3
Loading