From 1fd61ce6a40b6a73e991e358f686a6dfa1e34318 Mon Sep 17 00:00:00 2001 From: Nikolay Govorov Date: Mon, 8 Dec 2025 14:21:47 +0000 Subject: [PATCH] Add 'tini' as init process for docker --- Dockerfile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Dockerfile b/Dockerfile index 919a9a65..b360785c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -58,6 +58,9 @@ RUN make build FROM debian:stable-slim +RUN apt-get update -yq && \ + apt-get install -yq tini + # copy ca certificates COPY --from=0 /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt @@ -65,4 +68,8 @@ COPY --from=0 /browser/zig-out/bin/lightpanda /bin/lightpanda EXPOSE 9222/tcp +# Lightpanda install only some signal handlers, and PID 1 doesn't have a default SIGTERM signal handler. +# Using "tini" as PID1 ensures that signals work as expected, so e.g. "docker stop" will not hang. +# (See https://github.com/krallin/tini#why-tini). +ENTRYPOINT ["/usr/bin/tini", "--"] CMD ["/bin/lightpanda", "serve", "--host", "0.0.0.0", "--port", "9222"]