First things first. I’m making my first steps in the world of Docker so please be indulgent to me if I say something stupid
I’m trying to figure out why hot reloading doesn’t work when I run docker-compose up --build.
My Docker file:
FROM node:alpine
WORKDIR ‘/app’
COPY package.json .
RUN npm install
COPY . .
CMD [“npm”, “run”, “start”]
Docker-compose.yml
version: ‘3’
services:
web:
build:
context: .
dockerfile: Dockerfile.dev
ports:
- “3000:3000”
volumes:
- /app/node_modules
- .:/app
tests:
environment:
- WATCHPACK_POLLING=true
build:
context: .
dockerfile: Dockerfile.dev
volumes:
- /app/node_modules
- .:/app
command: [“npm”, “run”, “test”]
There’s an .env file in the root directory with WATCHPACK_POLLING=true line included.
I can make changes in the content of the web page but not in the test file.
Can anyone explain why? What did I do wrong?