Skip to content

Commit fdb523a

Browse files
committed
Switch Docker base image from Alpine to Debian slim
Devcontainer tooling (git/gh/docker-outside-of-docker features, Playwright's OS dependency installer) expects an apt-based distro; Alpine's musl/apk environment isn't supported by most of it. Debian slim keeps a similar image size while being broadly compatible. Updates the production runner stage's user creation to Debian's groupadd/useradd (Alpine's addgroup/adduser aren't available), and drops the now-unnecessary libc6-compat package (Alpine-only, not needed on glibc-based Debian).
1 parent c8c46d9 commit fdb523a

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

Dockerfile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
#syntax=docker/dockerfile:1.2
2-
FROM node:26.5.0-alpine@sha256:e88a35be04478413b7c71c455cd9865de9b9360e1f43456be5951032d7ac1a66 AS base
2+
FROM node:26.5.0-slim@sha256:715e55e4b84e4bb0ff48e49b398a848f08e55daed8eb6a0ea1839ae53bc57583 AS base
33

44
# Install dependencies only when needed
55
FROM base AS deps
66
ARG NEXT_PUBLIC_SENTRY_DSN
77

8-
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
9-
RUN apk add --no-cache libc6-compat
108
WORKDIR /app
119

1210
COPY package.json package-lock.json ./
@@ -46,8 +44,8 @@ ENV NODE_ENV production
4644
# Uncomment the following line in case you want to disable telemetry during runtime.
4745
# ENV NEXT_TELEMETRY_DISABLED 1
4846

49-
RUN addgroup --system --gid 1001 nodejs
50-
RUN adduser --system --uid 1001 nextjs
47+
RUN groupadd --system --gid 1001 nodejs
48+
RUN useradd --system --uid 1001 --gid nodejs nextjs
5149

5250
COPY --from=builder /app/public ./public
5351

0 commit comments

Comments
 (0)