Accepted answer

UPD Fixed in nodejs@12.4.0?

Check if this is linked to nodejs/docker-node issue 813:

Root cause seems to be: Thread stack size

The default stack size for new threads on glibc is determined based on the resource limit governing the main thread’s stack (RLIMIT_STACK).
It generally ends up being 2-10 MB.

There three possible solutions:

You already tried the third option, but consider also:

Alternatively, you should switch to the slim (Debian) variant until this get's fixe upstream by the Alpine team.


I faced same issue in Docker for node-alpine image when I am dockerizing my react application

I resolved with following dockerfile configuration.

FROM node:8.10.0-alpine

# Set a working directory
WORKDIR /usr/src/app

COPY ./build/package.json .
COPY ./build/yarn.lock .

# To handle 'not get uid/gid'
RUN npm config set unsafe-perm true

# Install Node.js dependencies
RUN yarn install --production --no-progress

# Copy application files
COPY ./build .

# Install pm2
RUN npm install -g pm2 --silent

# Run the container under "node" user by default
USER node

CMD ["pm2", "start", "mypm2config.yml", "--no-daemon", "--env", "preprod"]

Related Query

More Query from same tag