Next.js Discord

Discord Forum

Nextjs hot reload not working in docker container

Unanswered
Chinese Alligator posted this in #help-forum
Open in Discord
Chinese AlligatorOP
Hi, so when I tried running my docker container for Nextjs, it's not detecting the changes. The files in the docker container is synced btw.

I'm on windows11 currently.

This is part of my docker-compose for Nextjs:
    client:
        build: ./client
        ports:
            - "3000:3000"
        environment:
            NEXT_PUBLIC_API_URL: http://localhost:5000
            CHOKIDAR_USEPOLLING: true
        volumes:
            - ./client:/app
            - client_node_modules:/app/node_modules
            - /app/.next


Dockerfile:
FROM node:20

WORKDIR /app

COPY package*.json ./
RUN npm install

COPY . .

EXPOSE 3000

CMD ["npm", "run", "dev"]

2 Replies

Northeast Congo Lion
👍
@Northeast Congo Lion 👍
Chinese AlligatorOP
?