Docker setup fails: createWorker fails

Hello,
I am trying to deploy my mediasoup based server onto a docker based setup and “createWorker()” fails with the following exception: [pid:36, code:2, signal:null].
The same server works without issues when deployed locally without docker.
Here is my Dockerfile:

FROM node:12
RUN mkdir -p /app
WORKDIR /app
COPY package.json /app
COPY yarn.lock /app
RUN yarn
COPY . /app
RUN yarn build
EXPOSE 10000-10100/udp
CMD [ “yarn”, “serve” ]

Any ideas what I might be missing?

Thank you,
Leo

You must compile mediasoup in the target host (the Linux version of your Docker image). “yarn install” needed. The same for any Node dependency that has C/C++ code.

Thanks, I have recompiled the app from within the docker container and it works now.

Need to figure out how to create proper image ahead of time without compiling after deployment. I have tried building it on a regular Ubuntu and it gave me createWorker() error when running on docker. I guess docker uses a special version of Linux.