I
I
Igor2019-09-14 23:33:48
Docker
Igor, 2019-09-14 23:33:48

Why doesn't Nuxt in Docker keep track of file changes?

Why doesn't Nuxt in Docker keep track of file changes?
For example, when I see the development with the same php, then the volumes are synchronized.
Thus, I can develop and test in docker
. But this did not work with Nuxt, the changes are not applied immediately, but only after a reboot.
docker-compose restart
Dockerfile-dev

FROM node:lts-alpine

RUN mkdir -p /nuxt-app/
WORKDIR /nuxt-app/

COPY ./package*.json /nuxt-app/

RUN npm install

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

docker-compose
# Nuxt publication
  nuxt-public:
    container_name: cc.nuxt_public
    build:
      context: ./nuxt_public
      dockerfile: Dockerfile-dev
    volumes:
      - ./nuxt_public:/nuxt-app/
    ports:
      - "127.0.0.100:3600:3000"
    expose:
      - "3000"

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
daniel_wesson, 2021-12-19
@daniel_wesson

Also faced the same problem. I dug up a solution that, in principle, works: add the following to nuxt.config.js :

watchers: {
  webpack: {
    aggregateTimeout: 300,
    poll: 1000
  }
}

Webpack will check every second if the file has changed. More on this in the doc .
Maybe someone will find this solution useful.

V
Vitaly Karasik, 2019-09-15
@vitaly_il1

Do you have nodemon installed?
https://medium.com/i22digital/development-setup-wi...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question