Chapter 6, lesson 11- Publishing changes

Hello everyone,

I hope someone knows the answer and will help me.

In lesson “Publishing changes”, I did every step as Mosh did. Have exact files as Mosh does. Yet when I compose the container up again and make changes to the codebase and save them, it doesnt trigger nodemon to rebuild the app.

This is my compose file section for backend :slight_smile:
backend:
depends_on:
- db
build: ./backend
ports:
- 3001:3001
environment:
DB_URL: mongodb://db/vidly
command: ./docker-entrypoint.sh
volumes:
- ./backend:/app

And this is my Dockerfile:

FROM node:14.16.0-alpine3.13

RUN addgroup app && adduser -S -G app app

USER app

WORKDIR /app

COPY package*.json ./

RUN npm install

COPY . .

EXPOSE 3001

CMD [“npm”, “start”]

Can anyone help please?

command: [“sh”, “./docker-entrypoint.sh”]

This will run the command sh first to start a new shell. Then the script will be executed in that shell.