'Docker container not updating on code change despite volumes

This is the container's Dockerfile

FROM node:14

WORKDIR /app_back

COPY package.json ./

RUN npm install

COPY . .

EXPOSE 3001

ENTRYPOINT [ "npm", "start" ]

This is the docker-compose configuration

version: '3.9'
services:
  front:
    build: ./front-end
    container_name: delivery-app-front
    ports:
      - 3000:3000
    depends_on:
      - back
    volumes:
      - ./front-end/src:/app_front/src
  back:
    build: ./back-end
    container_name: delivery-app-back
    ports:
      - 3001:3001
    depends_on:
      - db
    environment:
      - PORT=3001
      - MYSQL_USER=root
      - MYSQL_ROOT_PASSWORD=jossa
      - MYSQL_HOST=db
      - MYSQL_NAME=delivery-app-db
      - MYSQL_PORT=3306
    volumes:
      - ./back-end/src:/app_back/src
  db:
    platform: linux/x86_64
    image: mysql:5.7
    container_name: delivery-app-db
    ports:
      - 3002:3306
    environment:
      - MYSQL_ROOT_PASSWORD=jossa
    restart: 'always'
    cap_add:
      - SYS_NICE

And this is the file structure enter image description here

When I change something on app.js the container is not updating... I did the exact same configuration for the front-end and it is working fine..



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source