Use npm install with the repo npmrc so the lockfile generated on npm 11 installs cleanly during the image build.
19 lines
396 B
Docker
19 lines
396 B
Docker
FROM node:22-alpine AS build
|
|
WORKDIR /app
|
|
COPY package.json package-lock.json .npmrc ./
|
|
RUN npm install --legacy-peer-deps
|
|
COPY . .
|
|
RUN npm run build
|
|
|
|
FROM node:22-alpine AS runner
|
|
WORKDIR /app
|
|
ENV NODE_ENV=production
|
|
ENV HOST=0.0.0.0
|
|
ENV PORT=3000
|
|
ENV NITRO_HOST=0.0.0.0
|
|
ENV NITRO_PORT=3000
|
|
COPY --from=build /app/.output ./.output
|
|
EXPOSE 3000
|
|
USER node
|
|
CMD ["node", ".output/server/index.mjs"]
|