I'm having trouble getting my React app to work with Docker. When I set up a Dockerfile and try to run the app, it starts compiling and just never stops. I've even created a brand new Next.js application and faced the same issue. Here's my Dockerfile for reference: I'm using Node version 24.13 on Alpine, and after setting the work directory and copying over package.json, I run `npm install`. The app seems to set up fine, but when I access localhost:3000, it stays stuck on 'Compiling /...' until my RAM gets full and I have to restart my computer.
2 Answers
It sounds like your app might be stuck in a build loop. Could you share the build logs with us? Also, have you tried replacing `npm install` with `npm ci`? That sometimes helps with dependency issues.
Thanks for the tip! I'll try that and see if it resolves the compiling issue.
Make sure you're using the right command to start your app. Try making the entry point to your Docker container `npm run dev` in your `docker-compose.yml` file. You might need to add it under the command section there.

I haven't tried `npm ci` yet. Here are the build logs:
[Build details here]
The build seems to finish as expected, but it just won't load the app in the browser.