Skip to content

Commit e72c711

Browse files
author
Umoru Clement
committed
fix: use bookworm base image for backend security
1 parent 2e7f0aa commit e72c711

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

‎backend/Dockerfile‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
# ---- Build stage ----
2-
FROM python:3.12-slim AS build
2+
FROM python:3.12-slim-bookworm AS build
33

44
WORKDIR /app
55

66
COPY requirements.txt .
77
RUN pip install --no-cache-dir --user -r requirements.txt
8-
98
# ---- Production stage ----
10-
FROM python:3.12-slim AS production
9+
FROM python:3.12-slim-bookworm AS production
1110

1211
# Create a dedicated non-root system user to run the app
1312
RUN addgroup --system --gid 1000 appgroup && adduser --system --uid 1000 --ingroup appgroup appuser
1413

15-
# Install dumb-init for correct PID 1 signal handling, then clean up apt cache
14+
# Install dumb-init for correct PID 1 signal handling, then clean up apt cache to reduce image size
1615
RUN apt-get update && apt-get install -y --no-install-recommends \
1716
dumb-init=1.2.5-3 \
1817
&& rm -rf /var/lib/apt/lists/*

0 commit comments

Comments
 (0)