From 438dbc9f2318e1f0501b1c15307cea38bc7e59cb Mon Sep 17 00:00:00 2001 From: Louis Dionne Date: Thu, 13 Nov 2025 09:01:13 -0500 Subject: [PATCH] [docker] Ensure logs from the entrypoint are in /var/log This is useful because it ensures that all of the logs related to LNT are accessible in the same volume, on /var/log/lnt. This is not necessary when running the Docker containers locally, however it's really helpful when running the containers on an EC2 instance where we only have SSH access. Accessing the Docker logs is more difficult in these circumstances. --- docker/docker-entrypoint-log.sh | 5 +++++ docker/lnt.dockerfile | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100755 docker/docker-entrypoint-log.sh diff --git a/docker/docker-entrypoint-log.sh b/docker/docker-entrypoint-log.sh new file mode 100755 index 00000000..ae0e88f0 --- /dev/null +++ b/docker/docker-entrypoint-log.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +# This is the actual entrypoint script, which ensures that we can find the +# logs of the real entrypoint script in /var/log. +docker-entrypoint.sh 2>&1 | tee /var/log/lnt/entrypoint.log diff --git a/docker/lnt.dockerfile b/docker/lnt.dockerfile index 1f00aa3c..d2d17cbf 100644 --- a/docker/lnt.dockerfile +++ b/docker/lnt.dockerfile @@ -44,6 +44,6 @@ RUN --mount=type=bind,source=.,target=./lnt-source \ VOLUME /var/lib/lnt /var/log/lnt # Set up the actual entrypoint that gets run when the container starts. -COPY docker/docker-entrypoint.sh docker/lnt-wait-db /usr/local/bin/ -ENTRYPOINT ["docker-entrypoint.sh"] +COPY docker/docker-entrypoint.sh docker/docker-entrypoint-log.sh docker/lnt-wait-db /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint-log.sh"] EXPOSE 8000