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

154
Views
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
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!