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

341
Vistas
Node error ENOSPC when running pm2 with docker-compose

When my pm2 service is launched I get the following error:

Error: watch /usr/src/app/node_modules/zip-stream/node-modules/loadash/... ENOSCP
    at exports._errnoException (util.js:1034:11)
    at FSWatcher.start (fs.js:1400:19)
    at Object.fs.watch (fs.js:1426:11)
    at createFsWatchInstance (/usr/local/lic/node_modules/pm2/node_modules/chokidar/lib/nodefs-handler.js:37:15)
    ....
    at FSReqWrap.oncomplete (fs.js:114:15)

This occurs only when build and run the docker with:

docker-compose --build up

If I only build the docker, and then command inside the docker:

docker-compose exec downtorrent_back_dev bash

sh start.sh

then, it starts the service without any problems.

This is the docker-compose.yml file:

version: '3'
services:
  downtorrent_back:
    container_name: downtorrent_back_dev
    build:
      context: .
      dockerfile: Dockerfile-back.dev
    volumes:
      - ./back:/usr/src/app
    expose:
      - "10002"
      - "9090"
      - "51413"
    ports:
      - "10002:10002"
      - "9090:9090"

This the script start.sh that starts the service:

#!/bin/bash

# Fix limit on system for watching files
echo fs.inotify.max_user_watches=524288 | tee -a /etc/sysctl.conf && sysctl -p
npm dedupe

# Start transmission torrent client
service transmission-daemon start
# Start service
pm2 start start.config.json --only downtorrent --env dev --no-daemon

And this is the PM2 config file:

{
  "apps": [{
    "name": "downtorrent",
    "script": "./app.js",
    "watch": true,
    "ignoreWatch": ["newrelic_agent.log"],
    "instances": 2,
        "log_date_format" : "DD-MM-YYYY HH:mm Z",
    "exec_mode": "cluster",
    "env": {
      "NODE_ENV": "dev",
      "APP_PORT": 10002
    }
  }]
}

As you can see, I've already tried the proposed solution in this question for the ENOSCP problem, but still not working.

about 4 years ago · Santiago Trujillo
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