Skip to content

Commit a86ab02

Browse files
authored
[docker] Ensure logs from the entrypoint are in /var/log (#133)
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.
1 parent 62c6bfe commit a86ab02

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

docker/docker-entrypoint-log.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
3+
# This is the actual entrypoint script, which ensures that we can find the
4+
# logs of the real entrypoint script in /var/log.
5+
docker-entrypoint.sh 2>&1 | tee /var/log/lnt/entrypoint.log

docker/lnt.dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,6 @@ RUN --mount=type=bind,source=.,target=./lnt-source \
4444
VOLUME /var/lib/lnt /var/log/lnt
4545

4646
# Set up the actual entrypoint that gets run when the container starts.
47-
COPY docker/docker-entrypoint.sh docker/lnt-wait-db /usr/local/bin/
48-
ENTRYPOINT ["docker-entrypoint.sh"]
47+
COPY docker/docker-entrypoint.sh docker/docker-entrypoint-log.sh docker/lnt-wait-db /usr/local/bin/
48+
ENTRYPOINT ["docker-entrypoint-log.sh"]
4949
EXPOSE 8000

0 commit comments

Comments
 (0)