Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

454
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda