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"]