Skip to content

Commit

Permalink
Downgrader til node 18
Browse files Browse the repository at this point in the history
ellers plager dekoratoren oss med "body has already been consumed"
  • Loading branch information
toresbe committed Nov 21, 2024
1 parent eaea434 commit 50d32d3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
# - .github/dependabot.yml (fjern versjonspin for docker)
# - packages.json under "engines" (her leter dependabot npm)
# - .ncurc.js (automatiske oppdateringer for node-types)
FROM node:20-alpine AS dependencies
# pt er vi på node 18 fordi ellers plager dekoratoren oss med "body has already been consumed"
FROM node:18-alpine AS dependencies

WORKDIR /app
COPY package.json .
Expand All @@ -13,7 +14,7 @@ COPY .npmrc.dockerbuild .npmrc
RUN --mount=type=secret,id=NODE_AUTH_TOKEN NODE_AUTH_TOKEN=$(cat /run/secrets/NODE_AUTH_TOKEN) \
npm ci --prefer-offline --no-audit

FROM node:20-alpine AS builder
FROM node:18-alpine AS builder

ARG DIGISOS_ENV
ENV NEXT_PUBLIC_DIGISOS_ENV=${DIGISOS_ENV}
Expand All @@ -26,7 +27,7 @@ RUN npm run build
RUN npm prune --production


FROM node:20-slim AS release
FROM gcr.io/distroless/nodejs18-debian12 AS runner

ARG DIGISOS_ENV

Expand All @@ -42,4 +43,4 @@ COPY --from=builder /app/node_modules/ node_modules/
COPY package.json .
COPY . .

CMD ["npm", "start"]
CMD ["./node_modules/next/dist/bin/next", "start"]

0 comments on commit 50d32d3

Please sign in to comment.