I try to build docker with optimization, but when I try to to run it, it says
sh: next:not found
Here is dockerfile
FROM node:20-alpine AS builder
WORKDIR /src
## Set local timezone in alpine linux
ARG TZ="Europe/Bratislava"
ENV TZ=${TZ}
RUN apk upgrade -qU
&& apk add -qu tzdata
&& ln -s /usr/share/zoneinfo/${TZ} /etc/localtime
&& echo ${TZ} > /etc/timezone
&& rm -rf /var/cache/apk/*
COPY package.json package-lock.json ./
RUN npm ci
COPY . .
RUN npm run build
FROM node:20-alpine AS runner
WORKDIR /src
COPY --from=builder /src/package.json .
COPY --from=builder /src/package-lock.json .
COPY --from=builder /src/next.config.js .
COPY --from=builder /src/public ./public
COPY --from=builder /src/.next/standalone ./
COPY --from=builder /src/.next/static ./.next/static
EXPOSE 3000
CMD npx next start
This build got around 160MB and I want to avoid to COPY node_modules to runner because then it got almost 1GB size.