Reduce Nuxt Build Size

FROM node:16 
WORKDIR /usr/src/app
COPY . ./ RUN yarn EXPOSE 8080
ENV HOST=0.0.0.0
ENV PORT=8080
RUN yarn build CMD [ "yarn", "start" ]
yarn install --production
FROM node:16 as builder WORKDIR /usr/src/builder ADD . ./ RUN yarn install --production 
RUN yarn build --standalone
FROM node:16-alpine as starter WORKDIR /usr/src/app RUN yarn add "nuxt-start@2.15.8" COPY --from=builder /usr/src/builder/.nuxt /usr/src/app/.nuxt
COPY --from=builder /usr/src/builder/nuxt.config.js /usr/src/app/
COPY --from=builder /usr/src/builder/static /usr/src/app/
ENV HOST=0.0.0.0
ENV PORT=8080
ENTRYPOINT ["npx", "nuxt-start"]
EXPOSE 8080

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store