Skip to content

Commit 1fd61ce

Browse files
committed
Add 'tini' as init process for docker
1 parent ed3a562 commit 1fd61ce

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,18 @@ RUN make build
5858

5959
FROM debian:stable-slim
6060

61+
RUN apt-get update -yq && \
62+
apt-get install -yq tini
63+
6164
# copy ca certificates
6265
COPY --from=0 /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
6366

6467
COPY --from=0 /browser/zig-out/bin/lightpanda /bin/lightpanda
6568

6669
EXPOSE 9222/tcp
6770

71+
# Lightpanda install only some signal handlers, and PID 1 doesn't have a default SIGTERM signal handler.
72+
# Using "tini" as PID1 ensures that signals work as expected, so e.g. "docker stop" will not hang.
73+
# (See https://github.com/krallin/tini#why-tini).
74+
ENTRYPOINT ["/usr/bin/tini", "--"]
6875
CMD ["/bin/lightpanda", "serve", "--host", "0.0.0.0", "--port", "9222"]

0 commit comments

Comments
 (0)