Docker Community Forums

Share and learn in the Docker community.

Docker and compose is not updating file changes

Hello I have the following structure to upload my project in typescript node js

my docker file:

#building code

FROM node:lts-alpine

RUN mkdir -p /home/node/api/node_modules && chown -R node:node /home/node/api

WORKDIR /home/node/api

COPY ormconfig.json .env package.json yarn.* ./

USER node

RUN yarn

COPY --chown=node:node . .

EXPOSE 4000

CMD node dist/src/index.js

my docker-compose:

version: '3.7'

services:

  db:

    image: postgres:12

    restart: always

    container_name: 'db'

    ports:

      - '${DB_PORT}:5432'

    volumes:

      - db_data:/var/lib/postgresql/data

    environment:

      POSTGRES_USER: ${DB_USER}

      POSTGRES_PASSWORD: ${DB_PASS}

      POSTGRES_DB: ${DB_NAME}

  api:

    image: ci-api

    restart: always

    depends_on:

      - db

    ports:

      - '${SERVER_PORT}:${SERVER_PORT}'

volumes:

  db_data:

I use the following command:

docker build -t ci-api.

and docker-compose up -d

but for some reason it’s not updating the changes I made to my files,

I make a change and try to use docker-compose down

and docker build again, but the files don’t update