Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

458
Visualizações
package.json not found in node:13-alpine docker container

I made 2 docker images from 2 folder in this repo. The dockerfile was:

FROM node:13-alpine
EXPOSE 5000
RUN mkdir /app
RUN mkdir -p /home/app
COPY . /home/app
RUN npm install
CMD ["npm","run","start"]

But the docker logs showed that the package.json file was not found and hence the containers closed, I can't even enter the terminal of the containers to see the available files.

The error output is in the below image.

enter image description here

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

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

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
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda