Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker compose hot reloading does not work with vuejs app

I have a little vueJS app runnig on docker. When i run the app via yarn serve it runs fine, also it does in docker.

My problem is hot reloading will not work.

My Dockerfile:

FROM node:12.2.0-alpine

WORKDIR /app
COPY package.json /app/package.json
RUN npm install
RUN npm install @vue/cli -g

CMD ["npm", "run", "serve"]

My docker-compose.yml:

version: '3.7'

  services:

    client:
      container_name: client
      build:
        context: .
        dockerfile: Dockerfile
      volumes:
        - '.:/app'
        - '/app/node_modules'
      ports:
        - '8082:8080'

Does anyone can see the mistake i did?

like image 210
pkberlin Avatar asked Sep 02 '25 16:09

pkberlin


1 Answers

I found a solution: I added the following to my compose file:

environment: 
  - CHOKIDAR_USEPOLLING=true
like image 64
pkberlin Avatar answered Sep 04 '25 13:09

pkberlin