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

161
Vistas
Cannot find module '/home/backend/dist/src/server.js' with Docker

Very new to Docker but When trying to run the container after building I get the following error, has anyone ran into this before?

'internal/modules/cjs/loader.js:905
throw err;'
^

'Error: Cannot find module '/home/backend/dist/src/server.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
at Function.Module._load (internal/modules/cjs/loader.js:746:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []'

I have built without docker and seems to work fine I run the following commands against the dockerfile (below):

docker build -t [name] .

docker run [name]

 FROM node:14.17.1 as base
 WORKDIR /home/backend
 //Add package file
 COPY package.json ./
 COPY yarn.lock ./
 //Install deps
 RUN yarn install

 //Copy source
 COPY src ./src
 COPY tsconfig.json ./tsconfig.json

 //Build dist
 RUN yarn build

 //Start production image build
 FROM gcr.io/distroless/nodejs:14

 //Copy node modules and build directory
 COPY --from=base /home/backend/dist ./home/backend/dist

 //Expose port 5000
 EXPOSE 5000
 CMD [ "/home/backend/dist/src/server.js" ]
about 4 years ago · Juan Pablo Isaza
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