#Nuxt build taking hours in mac m2

1 messages · Page 1 of 1 (latest)

cold charm
#
FROM node:18.14.1

RUN mkdir -p /usr/src/nuxt-app
WORKDIR /usr/src/nuxt-app
COPY . .

RUN rm -rf node_modules
RUN yarn cache clean && yarn install --non-interactive
RUN yarn build

ENV NUXT_PUBLIC_API_URL=
ENV NUXT_HOST=0.0.0.0
ENV NUXT_PORT=3000

EXPOSE 3000 

ENTRYPOINT ["node", ".output/server/index.mjs"]
slow rose
#

that's really horrific. I can't imagine why that might be. is there anything unusual about your setup?

cold charm
#

for one I am building for amd64 from mac m2 machine

keen citrus
#

I don’t think this is directly related to Nuxt. Rather it’s an issue with Docker running on macOS. Generally I’ve found I/O latency to be dreadful. You could try configuring Docker (if using the Desktop version) to use NFS or SMB file sharing which can improve I/O operation speeds. Alternatively, consider creating volumes particularly for node_modules and build destinations, which helps with caching and shortens the data path from a Linux system call to macOS and back again. Also, take a look at the resources docker has available to it. A few months back I saw an anomaly where on one MacBook a default docker instance was utilising 6GB of RAM but was limited to 2GB on another. Hope you find some resolution.

cold charm
#

oh yeah it does seem to have these configurations. thanks @keen citrus will check it out

cold charm
#

6549s to 803s nice, 8 CPU, 12GB ram, 2GB swap. 👍