Docker doesn't see my changes in next.js
Unanswered
Dwarf Crocodile posted this in #help-forum
Dwarf CrocodileOP
Hi, I am running my next.js application with docker in dev mode, but when I make any changes in next.js docker doesn't see it. hot refresh doesn't work
version: '3.8'
services:
next:
build: ./frontend
volumes:
- ./frontend:/var/www/frontend
ports:
- '3000:3000'
environment:
NODE_ENV: development
command: npm run dev
FROM node:20-alpine
WORKDIR /var/www/frontend
COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 3000
CMD ["npm", "run", "dev"]
10 Replies
umm why are you running dev in docker?
And thats expected behaviour.
If I'm right, Docker container is completely isolated, so the changes don't sync up with docker app
Dwarf CrocodileOP
Then should I use docker only in production environment?
@Yi Lon Ma docker also has a watch mode
but still, it doesn't make any sense to use docker in dev ig?
@Yi Lon Ma docker also has a watch mode
Dwarf CrocodileOP
I keep getting .next/package.json permission errors. Is there a sample project or video?
@Dwarf Crocodile Then should I use docker only in production environment?
Asiatic Lion
Or in staging environment. Where you test a replication of your prod environment.