diff --git a/Dockerfile b/Dockerfile index 73277c4c..c2db7266 100644 --- a/Dockerfile +++ b/Dockerfile @@ -146,6 +146,9 @@ RUN apt-get update \ && apt-get install -y libc6 \ && rm -rf /var/lib/apt/lists/* +# Install tini for proper init process +RUN apt-get update && apt-get install -y tini && rm -rf /var/lib/apt/lists/* + # Set the ENV for docker image ENV WHATSAPP_DEFAULT_ENGINE=$WHATSAPP_DEFAULT_ENGINE @@ -170,4 +173,6 @@ ENV WAHA_ZIPPER=ZIPUNZIP # Run command, etc EXPOSE 3000 +# Use tini as init system to handle zombie processes properly +ENTRYPOINT ["/usr/bin/tini", "--"] CMD ["/entrypoint.sh"] diff --git a/entrypoint.sh b/entrypoint.sh index 1da7dfef..1d86ef6c 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -7,5 +7,5 @@ uv_threadpool_size=$(($cpus * 1)) # Set UV_THREADPOOL_SIZE as an environment variable export UV_THREADPOOL_SIZE="${UV_THREADPOOL_SIZE:-$uv_threadpool_size}" -# Start your application using yarn +# Start your application using node with exec to ensure proper signal handling exec node dist/main