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

418
Views
sh: 1: nuxt: not found when trying to dockerise the Nuxt app

sh: 1: nuxt: not found I'm always getting this error when trying to run the docker container. It's only working when I have node modules and a .nuxt folder mounted from my local. As soon as I delete them, that docker container starts giving the same error. Here is my dockerfile:

FROM node:16.14
WORKDIR /app
ADD package.json ./
RUN npm install
ADD . .

Here is my docker-compose.yml:

version: "3.9"
services:
  web:
    build: .
    restart: always
    container_name: myapp-nuxt
    volumes:
      - ".:/app"
    depends_on:
      - "server"
    environment:
      - NUXT_HOST=0.0.0.0
      - NUXT_PORT=3001
    network_mode: "host"
    command: npm run dev

PS - I tried following almost all tutorials. Issue is same with all of them.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The volumes: block hides absolutely everything that the Dockerfile does and overwrites it with different content from your host. More specifically, it hides the node_modules directory generated by RUN npm install and replaces it with whatever might happen to be on the host in that directory. You don't need this volumes: block and you can remove it.

# volumes:      <-- remove this block:
#   - ".:/app"  <-- don't overwrite the application code in the image

(Also consider removing the unnecessary container_name: option, moving the fixed environment: and command: settings into your Dockerfile, and not disabling Docker networking with network_mode: host. You can probably get the Compose definition down to just the build: line, the restart: policy, declaring depends_on:, and publishing ports:.)

about 4 years ago · Juan Pablo Isaza Report
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!