Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 759bf3e

Browse files
authored
Fix with-docker example fails to load image (vercel#25536)
node version should be 14, otherwise, next/image fails to load static file images located in public dir detail: https://stackoverflow.com/questions/67641673/next-js-app-running-inside-a-docker-container-fails-to-load-static-file-images
1 parent 8f6f62b commit 759bf3e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

examples/with-docker/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
# Install dependencies only when needed
2-
FROM node:alpine AS deps
2+
FROM node:14-alpine AS deps
33
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
44
RUN apk add --no-cache libc6-compat
55
WORKDIR /app
66
COPY package.json yarn.lock ./
77
RUN yarn install --frozen-lockfile
88

99
# Rebuild the source code only when needed
10-
FROM node:alpine AS builder
10+
FROM node:14-alpine AS builder
1111
WORKDIR /app
1212
COPY . .
1313
COPY --from=deps /app/node_modules ./node_modules
1414
RUN yarn build
1515

1616
# Production image, copy all the files and run next
17-
FROM node:alpine AS runner
17+
FROM node:14-alpine AS runner
1818
WORKDIR /app
1919

2020
ENV NODE_ENV production

0 commit comments

Comments
 (0)