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

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

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 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