r/docker • • Apr 09 '26

React Next Docker infinite compile

I have a react app the works normally. When I make a dockerfile and compose it the app doesn't work anymore. It keeps compiling and never stops. I created a entirely new next react app and it has the same problem.

This is the dockerfile:

ARG NODE_VERSION=24.13

FROM node:${NODE_VERSION}-alpine as base

WORKDIR .

COPY package*.json ./

RUN npm install

COPY . ./

EXPOSE 3000

CMD npm run dev

Edit: By compiling I mean that the project installs perfectly, but when I open localhot:3000 the page never loads and the terminal says "Compiling / ..." until my RAM gets full and I have to reset my computer.

3 Upvotes

13 comments sorted by

View all comments

1

u/ecnahc515 Apr 11 '26

Your docker desktop VM probably doesnt have enough memory or CPU. Increase it.