From d48180190752201865f41b2cf1e0a6740fa2ea59 Mon Sep 17 00:00:00 2001 From: Liam Crilly Date: Tue, 9 May 2023 22:53:18 +0100 Subject: Docker: show welcome page on port 80 when entrypoint.d is empty. The entrypoint script now performs a default configuration when no useful files are found in /docker-entrypoint.d/ The default configuration serves a welcome page in response to all requests, using Markdown unless text/html is sent in the Accept header. This provides a useful 'hello world' experience when running a Unit container for the first time. --- pkg/docker/template.Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'pkg/docker/template.Dockerfile') diff --git a/pkg/docker/template.Dockerfile b/pkg/docker/template.Dockerfile index 2ffc5a97..c6a72aa8 100644 --- a/pkg/docker/template.Dockerfile +++ b/pkg/docker/template.Dockerfile @@ -75,9 +75,10 @@ RUN set -ex \ && ln -sf /dev/stdout /var/log/unit.log COPY docker-entrypoint.sh /usr/local/bin/ +COPY welcome.* /usr/share/unit/welcome/ STOPSIGNAL SIGTERM ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] - +EXPOSE 80 CMD ["unitd", "--no-daemon", "--control", "unix:/var/run/control.unit.sock"] -- cgit