Go to your folder and run
docker initset the details accordingly
Go to Dockerfile and set it
FROM node
WORKDIR /src/app
COPY package*.json ./
# Run the application as a non-root user.
RUN npm install
# Copy the rest of the source files into the image.
COPY . .
# Expose the port that the application listens on.
EXPOSE 3000
# Run the application.
CMD npm run dev
Go to compose.yaml and set it
version: "3.9"
services:
frontend:
build:
context: .
dockerfile: Dockerfile
ports:
- 3000:3000
develop:
watch:
- path: ./package.json
action: rebuild
- path: ./package-lock.json
action: rebuild
- path: ./next.config.mjs
action: rebuild
- path: .
target: /src/app
action: sync
volumes:
tasked:
Then run for winows
docker compose upThen run for linux
sudo docker compose upFor realtime update Run
sudo docker compose watch