Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

155
Views
node modules does not copy to volumes

I'm doing a web project using docker. After installation of new node packages, I run the docker-compose build command and then the docker-compose up. Then it says there is no any package like that(newly installed one). But when I prune docker images and freshly started using docker-compose up things work perfectly.

What can be the potential issue?

I'm on an ubuntu machine and I use docker with root privileges.

    version: "3.8"

services:
  api:
    build:
      dockerfile: DockerFile
      context: ./api
      target: development
    volumes:
      - ./api:/nadeera/src/app
      - /nadeera/src/app/node_modules/

    command: npm run start:dev
    depends_on:
      - postgres
    environment:
      DATABASE_URL: postgres://user:password@postgres:5432/db
      NODE_ENV: development
      JWT_SECRET: hard_to_guess_secret_123
      PORT: 3000
    ports:
      - 3000:3000
      - 9229:9229

  frontend:
    build:
      dockerfile: DockerFile
      context: ./frontend
      target: development
    command: npm run start
    volumes:
      - ./frontend:/nadeera/frontend/src/app
      - /nadeera/frontend/src/app/node_modules
    ports:
      - 4200:4200
    links:
      - api

  postgres:
    image: postgres:10.4
    environment:
      POSTGRES_USER: user
      POSTGRES_PASSWORD: password
      POSTGRES_DB: db
    ports:
      - 35000:5432

  postgres_admin:
    image: dpage/pgadmin4:4.28
    depends_on:
      - postgres
    environment:
      PGADMIN_DEFAULT_EMAIL: admin@admin.com
      PGADMIN_DEFAULT_PASSWORD: password
    ports:
      - 5050:80

frontend DockerFile

FROM node:14 AS development

WORKDIR /nadeera/frontend/src/app

COPY package*.json ./

RUN npm install
RUN npm install -g @angular/cli@12.0.0

COPY . .

RUN npm run build

EXPOSE 4200

api DockerFile

FROM node:14 AS development

WORKDIR /nadeera/src/app

COPY package*.json ./

RUN npm install

# COPY . .

RUN npm run build

EXPOSE 3000


###################
###  Production ###
###################

FROM node:14 AS production

ARG NODE_ENV=production
ENV NODE_ENV=${NODE_ENV}

WORKDIR /nadeera/src/app

COPY --from=development /nadeera/src/app/ .

EXPOSE 3000

CMD ["node","dist/main"]
over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!