Home > front end >  package.json not found in node:13-alpine docker container
package.json not found in node:13-alpine docker container

Time:02-17

I made 2 docker images from 2 folder in enter image description here

To reproduce the error, clone the repo and run sudo docker-compose -f docker-compose.yaml up

CodePudding user response:

You didn't specify the working directory in your dockerfile and that's why the package.json cannot be found.

Ref: https://docs.docker.com/engine/reference/builder/#workdir

add WORKDIR before RUN npm install

WORKDIR /home/app
RUN npm install
  • Related