Background
We use Docker to containerize a Vue.js app and mount a volume with the source code.
Dockerfile
FROM node:13.8-alpine
RUN yarn install && \
apk add --no-cache git
COPY . /usr/src/app
WORKDIR /usr/src/app
EXPOSE 8080
CMD ['/bin/sh', 'start_compose.sh']
docker-compose.yml
version: '3'
services:
web:
build: .
volumes:
- .:/usr/src/app:delegated
ports:
- '8080:8080'
command: ['/bin/sh', 'start_compose.sh']
start_compose.sh
yarn install
npm rebuild node-sass
yarn serve
Problem
Hot reloading works generally, and code changes are usually immediately reflected in the browser.
But very often after a while, hot reloading stops working, and the code changes are not reflected in the browser.
Stopping and restarting the container fixes the issue for a while.
Question
What might be causing this problem and what is the solution?
Thanks!